Wednesday, 15 April 2015

hadoop - Making Hive substitution variables avialable for all the sessions.? -


If I have a replacement variable available for all hive sessions in the environment / database, that will be the best file set in it Do you? Is there any possibility to define my own config file and define variables and it is available for all queries?

Do I do it on the hive site? Can I do without using xml and hive-default.xm?

Regards, Nish

attempting to set its variable in .hverc file Please.

You can add a configuration or .hverc file and any custom variable in the hive will load this file on the launch of the shell.

For example: ' Set tablename = test ;' In the .hverc file you can select it from '$ {hiveconf: tableName}' in the hive shell, select '


batch file - Problems with Ampersand start as “Run as administrator” -


I wonder how can I create a .bat or .cmd file within a admin folder Run? Where is the same enders in the name "& amp;"? Every time I try to run the file, an error appears ... What did I do if I tried to run as an administrator CMD & amp; The name of the folder is an order.

Let me know, I have a folder named Project CMD & amp; Vbs and Project 01.bat called a file as long as I do not try to run it as an administrator until an error occurs does not come unless I folder Remove "& amp; strong> if CMD & VBS .

  folder name: CMD & VBS script name : project alternative form: context menu 01.bat execution run as the "Run" window version: 7  

Udahr Script:

  @ echo of Timt Remover - [WMP] Online music color 4f Reg Delete "HKEY_CLASSES_ROOT \ SystemFileAssociations \ Directory.Audio \ shellex \ ContextMenuHandlers \ WMPShopMusic" / f & gt; Nul 2 & gt; and 1 echo deleted messageBox "!", Vbinformation & gt;% temp% \ Msg.vbs Start / wait% temp% \ Msg.vbs & gt; tap 2 & gt; and 1 del% temp% \ Msg.vbs & gt; tap 2 & gt; and to work with the 1st exit  
& amp; character, you must save it ^ An example might help:

C: \ Temp> C Mr. can not take my test systems specified path 'Test' is went not recognized as an internal or external command, operative program or batch file.

C: \ Temp> cd my ^ & amp; Test

C: \ Temp \ my & amp; Test>


facebook graph api - Public feed from non-friend - changes/bugs? -


I was able to retrieve the public feed for non-friends. It seems that now I always get an empty list.

Process:

  • I use / feed with my access token
  • No matter what version

Any changes in privacy settings etc. are known, which can be the reason for this?

You should never be able to access non-friends' public feeds. Even access to your feed is restricted, because read_stream will not be approved by Facebook.

Just because some "public" does not mean that you can catch it on Facebook API.


excel - reference is not valid VBA hyperlink creation -


I am trying to create a hyperlink that references the previously used variable. The link is linked to a job number, which the user can click to verify the job information before printing a worksheet. I am using variables and I am unsure if this problem is causing or if the whole thing is unfathomable

This is my first time that some attempts should be made with these lines, so the prospects are endless Maybe.

Here's a piece of code, in which I'm having trouble. The error I receive is "invalid process call or logic"

  with POSheet .hyperlinks.Add anchor: = range ("J11"), _ address:. = "", _ SubAddress: = shtJob.Name, _ Screen Tip: = "Job Sheet", _TextToDisplay: = "Job Information"  
More code if necessary

I post Finish with can

Try below You need to set the subaddress property for the hyperlink to the current workbook. Note that the string "Sheet1 A1!" If you want a hyperlink to go to sheet 1 cell A1, then

  should look like with the POSheet .Hyperlinks.Add anchor:. =. Range ("J11"), _ Address: = "", _ Subeder: = Shtozob. Name & amp; "! A1", _ Screen Tip: = "Job Sheet", _ TextToDisplay: = "Job Info"  

c# - Stopwatch and DateTime.UtcNow producing unexpectedly large timing variations -


We have application logs that have record performance information for various expensive actions, we have stopwatch And DateTime.UtcNow , and we are aware that these values ​​may be different than expected, even the date time is also given. ~ 20 ms precision of UtkNo My question is What can be the reason for this and can it be decided?

The recorded information is:

  • Start time ( dateTime.UtcNow )
  • Duration ( TimSpainFormsCondus (later) / (Double stopwatch frequency) , where after and first have stopwatch values . At the beginning and end of operation
  • End time ( DateTime.UtcNow )

If you are close to starttime + duration of end time But in some cases this path is closed . We have sampled 10000 such measurements, where looking for cases is end-time and (starttime + duration) differences are more than 20 milliseconds. We found the following:

  • ~ 2% entries are closed> 20ms
  • Of these, 100ms average of this (maximum 1.4seconds)
  • Of these, the stopwatch-count expiration time in some cases is higher than the time-based expiration time, but in most cases, Windows Server 2012 R2 Hyper-V VM runs at the top of the Stopwave Windows Server 2012 R2 is
  • Machine information

    • 32 GB RAM for VM, 8 virtual CPUs
    • < / Ul>

This is expected to be Uses stopPouchformsCounter (QPC) under the Stopwatch hood, while DateTime.UtcNow uses the computer's real-time clock (RTC) is.

  • QPC comes from your CPU's timestamp counter (TSC), and it is very accurate , but accuracy in relation to UTC There is no basis for this.
  • RTC is on the computer's motherboard, and is usually made with cheap crystal oscillators, it is accurate , but is not exact .

To measure the time elapsed, you want to be precise, and thus stopwatch .

For the current time of day, you want accuracy, and thus DateTime.UtcNow .

Should use a lot of support details.

The difference you have measured is due to the clock drift in RTC. Your RTC (All Self) will fall a few milliseconds forward or behind real time. It is quite normal, and is used by NTP synchronization from time to time. For minor adjustments, the OS will spread a few milliseconds at one time, improving small intervals during intervals.

As far as an alternative is solved, you might consider a class like this:

  Public Static Class Accurate Clock {Private Stable Readonly Datetime Start Date = DateTime .Utc now; Private stationary readwatch stopwatch stopwatch = stopwatch Startup (); Public static date time GetCurrentUtcTime () {start starttime + stopwatch Apple; }}  

However, the downside is that you are making assumptions that the RTC is in perfect sync when the class is started. In fact, you are not sure about it.

If you want to guarantee the some level, then you can consider making the NTP call own I have applied a class that is actually Does in It implements the interface from iSCLock It periodically calls an NTP server, and tracks the time between the call using the stopwatch . You will use it like this:

  // Clock clocking example var watch = NetworkClock.Instance grab; // Alternatively set up NTP server during your app's startup clock. Npserver = "pool.ntp.org"; // or whatever server you want to sync // whenever you want the Datetime UTCNO = clock, get current UTC time. Now. ToDateTimeUtc (); In addition, there is something like "Multimedia Timer" or "High Precision Event Timer" (HPET) which is available on most modern hardware. It provides  more accurate  than the QPC, however, there is no direct category that displays in the .NET framework. If you search, you will find some implementations that wrap the Win32 function that provides it. Generally, this is redundant until you are talking things like graphics or audio from real time. 


How to upload products from one Prestashop store to another Prestashop store? -


We have two prestashop domains, for example abc.com and xyz.com with different databases. We want to upload products from one Prestashop store to another Spring Shop store. As we know all product images will be stored in Prestashop's IMG folder. Now we want to use these images from Store 1 and upload 2 IMG folders to store and want to synchronize only product related data from Database 1 to Database 2.

Please provide your valuable suggestions.

The same task of copying data from a database to managing products on two similar sites My sites are completely identical.

  1. The same option has a multi-touch facility in comparison with two sites with the same product, features and images in the same back office. It is very convenient for more than one shop management.

  2. The second option is that you do not want multipop options instead of exporting ps_product_shop, ps_image, ps_product, ps_product_lang tables and if the products already exist, then the use of the product 'new location' Compared to or not present in the new location. If the products already exist.

Depending on your needs,

make sure that you do 'REPLACE' rather than 'INSERT INTO', if you are not sure whether the product is being repeated or not.

Do something like

  type the lock tab `ps_product_shop`; / *! 40000 optional table `ps_product_shop` disabled keys * /; Change to `ps_product_shop` values ​​(1000010,1,1112, ------------------- .................. .................................................. .................................................. .................................................. ................................................ .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. ..................................... from my other site New p folder. (Or p_old the name of the old p folder and open the new p folder there.) This works fine for me, I hope this will help you. 


javascript - accessing different elements of an HTML tag -


& lt; a href = "#" id = "

मेरे पास एक बटन है: फॉर्म-जमा करें "वर्ग =" बीटीएन बीटीएन-प्राथमिक बीटीएन-एलजी लाडा-बटन "डेटा-शैली =" अनुबंध "डेटा-आकार =" एल "& gt; & Lt; span class = "ladda-label" & gt; TESTLABEL & lt; / span & gt; & Lt; / a & gt;

और मैं इसके अंदर पाठ को एक्सेस करने का प्रयास कर रहा हूं: IF statement के माध्यम से TESTLABEL मैं इस तरह से पाठ बदल सकता हूँ:

  $ ('# form-submit')। पाठ ('जीओ')। बटन ("ताज़ा करें");  

लेकिन यह अगर / else बयान हर बार कोड का पहला समूह चलाता है - कभी भी else अगर भाग नहीं होता है।

  console लॉग (। $ ( '# रूप से जमा कर सकते') पाठ ()); यदि ($ ('$ form-submit')। पाठ ('TESTLABEL')) {$ ('# form-submit')। पाठ ('जीओ')। बटन ("ताज़ा करें"); } और अगर ($ ('$ form-submit')। पाठ ('गो')) {// अन्य कोड करना है ...}  

जब मैं बटन क्लिक करता हूं - पाठ TESTLABEL है, और जब मैं क्लिक करता हूं तो GO में बदल जाता है जब मैं फिर से क्लिक करता हूं, console.log मुझे बताता है कि यह बटन पाठ गया है, लेकिन पहले अगर बयान अभी भी चलता है जैसे कि इसके टेक्स्ट TESTLABEL थे। क्या मैं गलत कर रहा हूं?

सबसे पहले पाठ span तत्व के अंदर है # फ़ॉर्म-जमा तत्व के भीतर, इसलिए आपको $ ('# form-submit span') या $ ('# form-submit.ladda- लेबल ') इसे चुनने के लिए।

दूसरे, यदि आपके बयान में आप text () विधि का सेटर संस्करण का उपयोग कर रहे हैं यह हमेशा को सच के समान समझाता है क्योंकि विधि एक jQuery ऑब्जेक्ट देता है। इसके बजाय, प्राप्तकर्ता का उपयोग करें। इसे आज़माएं:

  var $ बटन = $ ('# form-submit') var $ label = $ button.find ('span'); यदि ($ label.text () == 'TESTLABEL') {$ label.text ('GO'); $ Button.button ( "ताज़ा"); } और अगर ($ label.text () == 'जीओ') {// अन्य कोड करते हैं ...}  

mysql - Query within php isn't working -


I do not have much experience with php and mysql. This plan was to create a text box, whatever you want within this text box Can write. And then the text within the text box will be updated in the database.

It says that the mistake is within this line:

  $ sql = "updated member SET tekst = '$ _ POST [' chat ']' WHERE id = '$ _ Session [' id ']' ";  

This line is within the next code:

   

Thank you in advance,

Gyon

< Do not use P> mysql_query, but try this:

  $ chat = mysql_real_escape_string ($ _ POST ['chat']); $ Id = $ _SESSION ['id']; $ Sql ​​= "Update members SET tekst = '$ chat' WHERE id = '$ id'";  

ubuntu 14.04 - FFmpeg simple 1:1 overlay and concatenate? -


I am using FFPAG at Ubuntu 14.04 (PPA of John Severinson) and one-one video files I'm playing

The first question I could not figure out yet - how can I add a simple overlay - 720p footage with 720p overlay (with partial transparency)? Therefore no size or alignment is needed - just 1: 1 overlay. I tried to do a lot already - VF and - filter_comax but did not show up.

Second question - with engagement, is it possible to switch between files? Best without creating a new file - So, on the fly? I need to reduce the gap between file switch or eliminate them completely.

This is my block right now:

  #! / Usr / bin / env bash while:; Do files = (*) ffmpeg -re -i "$ {files [$ RANDOM% $ {# files [@]}]}" -Codecode copy-vcodec copy -f flv server has been done  
< P> Then I have everything / vod - videofiles, plus overlay page

Thanks a bunch in advance, Tim

overlay, you have to scale the image to the original source dimensions.

To collect multiple source files that have the same codec used.

Example:

Make a playlist.txt with the following format:

  file '/ path / to / File_1 'file' / path / to / file_2 'file' / path / to / file_3 '[..]  

and then:

  ffmpeg - F concat -i playlist.txt -i overlay.png -filter_complex "[1: v] scale = 1280: 720 [ovr]; [0: V] [ovr] overlay = 0: 0" ...  

If the video and image are the same size then you can use it:

  ffmpeg -f concat -i playlist.txt -i overlay.png -filter_complex "[ 0: V] Overlay " 

Update : Full example:

You can stream the video stream at the same time Can not filter and copy!

  Ffmpeg -re -f concat -i playlist.txt -i overlay.png -filter_complex "[0: v] overlay" -c: v h264 -c: a libfdk_aac -ar 44100 -f flv rtmp: // ...  

If your audio stream is valid and is one of supported audio rates (44100, 22050, 11025) then you can do this Are:

  ffmpeg -re -f concat -i playlist.txt -i overlay.png -filter_complex "[0: v] overlay" -c: v h264 -c: one per -f Flv rtmp: // ...  

Simple serialization and deserialization in C++ -


I need to serialize different types of objects (but type obtained from the same class) and then base them The class indicator, which contains the derived class. For example:

  # include & lt; Iostream & gt; #to & lt include, fstream & gt; Class A {public: int a; Virtual Zero Func () {}}; Class One 1: Public A {Four S [128]; Zero Func1 (int l) {std :: cout & lt; & Lt; L & lt; & Lt; '\ N'; } Zero fun () {funk 1 (156); }}; Int main () {One * x = New One 1; X- & gt; Ceremony (); Four * y = (four *) x; Remove x; / * Std :: offream out ("test11.txt", std :: ofstream :: out | std :: ofstream :: trunc); Out.write (y, sizeof (One1)); Out.close (); Std :: ifstream in ("test11.txt", std :: ifstream :: in); Four * y1 = new four [size (solid 1)]; In.read (y1, size (forest 1)); * / A * z = (one *) y / * 1 * /; Z- & gt; Ceremony (); Return 0; }  

This code output

  156 156  

But when I repeat the comments (when I write Trying to represent a four object to a file and read from this file), output to the program 156 and assign it to z-> Ceremony (); . I have checked that the variable y has different content than y1 . Why?
What is the reason for that issue and how can I play it (perhaps using some special libraries)?

1 do not serialize derived sections by just copying bytes

By plugging in a byte array and then loading them by binary read , you can not type multicolored objects. Dump to an event of class generated derivative class for implementing virtual function with Store Points, will result in dump stored pointers in Vettel, which - compliant - should not be a valid indicator once again after running the program. Most likely a split error will arise after reaching it.

If you really want to use the easy way (directly byte reading and writing), then use the squares.

2. Do not access invalid sign recipes

The most important part of the above answer (because it will completely change your program), other things also need to be underlined. Command:

  four * y = (four *) x; Indicates the   

address of x indicates a four indicator Copy this no object, like this when you do it later:

  delete x;  

y becomes an indicator invalid when you try to write that file later:

< Pre> std :: ofstream output ("test11.txt", std :: ofstream :: out | std :: ofstream :: trunc); Out.write (y, sizeof (One1));

You can use memory that is not yours . At least not now, because you said in the specification that you do not need to call delete first.


javascript - Multiple $(document).ready(function() but only the top couple are firing -


Question: How can I ensure that all my $ (documents) .ready Only the first couple?

I'm trying to change the value of the hidden field on my form to use an external .js file whether or not the box is checked. Now the .js file looks like this:

  $ (document) .ready (function () {$ (function () {$ ('[name = "c1"]') 'Change', function () {$ ('[name = "i1"]'). Val ('cargo');});});}); $ (Document) .ready (function () {$ (function () {$ ('[name = "c2"]'). ('Change', function () {$ ('[name = "i2"] ') .val (' waro ');});});}); $ (Document) .ready (function () {$ (function () {$ ('[name = "c3"]'). ('Change', function () {$ ('[name = "i3"] ') .val (' waro ');});});}); $ (Document) .ready (function () {$ (function () {$ ('[name = "c4"]'). ('Change', function () {$ ('[name = "i4"] ') .val (' daily ');});});}); $ (Document) .ready (function () {$ (function () {$ ('[name = "c5"]'). ('Change', function () {$ ('[name = "i5"] ') .val (' daily ');});});});  

I have a check box inside my table:

& lt; Input type = "checkbox" id = "c1" name = "c1" value = "17 9 43" & gt; & Lt; Input type = "hidden" name = "i1" value = "" /> ... (one of these for each box)

What is happening is that the first 3 of these ready calls will have to work properly and then when another box changes Will be checked. (I'm testing it on chrome.) I've found that the Help Forum suggests that it is not looking down on the page because there is some error, but since they are all the same work, I'm not sure How to determine what the error might be and fix it.

So - how can I make sure that all my $ (document) .ready do not add pieces only and not first?

So far, I have seen some suggestions for using $ instead of $ (.live) . , however, that change does not affect the end result. I have changed all of my names into a set as if I had seen some pages, but she failed to do anything, so I went back to different tasks.

I am using WordPress and the only way to get a .js code on a page is to load the file from an external file, so carrying the code around the page is not really an option. The very .js file is being told from the header.ff file on WordPress right now, beyond a very wide header or footer option (at least without the better directions, I'm able to find it on Google).

I'm not sure you're using more than one document. calls for one reason, but if possible, you should add them to one:

  $ (function () {$ ('[name = "c1"] '' 'Change', function () {$ ('[name = "i1"]'). Val ('wargo');}); $ ('[name val' ('wargo';)); $ ('[Name = "c3" = "c2"]). (' Change ', function () {$ (' [name = "i2"] ']' '(' change ', function () {$ ('[Name = "i3"]). Val (' warga ');}); $ (' [name = 'c4'] ') (' change ', function () {$ (' [name = '] ('' Change '', 'function'); $ ('[name =' i5 ' ). Val ('Daily');});});  

Multiple documents. First functions It is permissible and should work in theory. It seems that an error is being thrown away which is preventing others from executing. By adding them to the same function, you will give all or some results.


c++ - cin and getline skipping input -


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

  • 2 जवाब

पहले मैंने एक प्रश्न पोस्ट किया cin इनपुट को छोड़ देना, और मुझे परिणामों को फ्लश करने के लिए मिला, और istringstream का उपयोग किया गया, लेकिन अब मैंने हर संभव समाधान की कोशिश की लेकिन उनमें से कोई भी काम नहीं करता।

यहां मेरा कोड है:

  शून्य बनाने के लिए नया ग्राहक () {string name, address; Cout & lt; & lt; "एक नया ग्राहक बना रहा है ..." & lt; & lt; endl; Cout & lt; & lt; "ग्राहक का नाम दर्ज करें:"; गेटलाइन (पाप, नाम); Cout & lt; & lt; "ग्राहक का पता दर्ज करें:"; गेटलाइन (पिन, पता); ग्राहक ग (नाम, पता, 0); CustomerDB :: addCustomer (ग); Cout & lt; & lt; endl; }  

लेकिन मुझे अभी भी एक ही चीज़ मिल रही है, इनपुट छोड़ना है, और जब यह इनपुट लेता है, तो ये उन्हें लेता है और नाम से कुछ भी खाली नहीं रखता है, और पते में यह लिखा है जो मैंने लिखा था

मेरे कोड में क्या गलत है

मैंने कोशिश की cin.ignore () ,

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

Main.cpp में मुख्य विधि invokes मुख्य मेनू () केवल

  शून्य मुख्य मेनू () {char पसंद; करना {system ("cls"); mainMenuDisplay (); Cin & gt; & gt; विकल्प; प्रणाली ( "cls"); स्विच (पसंद) {मामला '1': ग्राहक मेनू (); टूटना; मामले '2': डीवीडीमेनू (); टूटना; मामले '3': रसीदमैनू (); टूटना; मामले '4': आउटरो (); टूटना; डिफ़ॉल्ट: cout & lt; & lt; '\ए'; } Cin.ignore (); cin.get (); } जबकि (विकल्प! = '4'); }  

मैं ग्राहक उदाहरण के लिए 1 का चयन करूंगा, यह ग्राहक मेनू ()

  शून्य ग्राहक मेनू () {चार विकल्प ; करना {system ("cls"); manageCustomerMenu (); Cin & gt; & gt; विकल्प; प्रणाली ( "cls"); स्विच (पसंद) {मामला '1': createNewCustomer (); टूटना; मामले '2': हटाएं ग्राहक (); टूटना; मामले '3': updateCustomerStatus (); टूटना; मामले '4': दृश्य ग्राहक सूची (); टूटना; मामले '5': मुख्य मेनू (); टूटना; डिफ़ॉल्ट: cout & lt; & lt; '\ए'; } Cin.ignore (); cin.get (); } जबकि (पसंद! = '5'); }  

मैं एक नया ग्राहक ऑब्जेक्ट बनाने के लिए 1 बार फिर से चुनता हूं, जो अब मेनफंक्शन सीपीपी पर जाएंगे, जो फ़ंक्शन createNewCustomer () को लागू करेगा पहले एक।

  शून्य बनाएँनई ग्राहक () {string name, address; Cout & lt; & lt; "एक नया ग्राहक बना रहा है ..." & lt; & lt; endl; Cout & lt; & lt; "ग्राहक का नाम दर्ज करें:"; cin.getline (नाम, 256); Cout & lt; & lt; "ग्राहक का पता दर्ज करें:"; cin.getline (पता, 256); ग्राहक ग (नाम, पता, 0); CustomerDB :: addCustomer (ग); Cout & lt; & lt; endl; }  

यदि आप getline के बाद सीन & gt; & gt; कुछ , आपको बफर के बीच में न्यूलाइन को फ्लश करने की जरूरत है।

इस के लिए मेरी व्यक्तिगत पसंदीदाता है कि यदि कोई नई पंक्ति अतीत में वर्णों की आवश्यकता हो तो cin.sync () । हालांकि, यह क्रियान्वयन को परिभाषित किया गया है, इसलिए यह उसी तरह काम नहीं करेगा जैसा कि मेरे लिए करता है कुछ ठोस के लिए, cin.ignore () का उपयोग करें। या वांछनीय अगर अग्रणी सफेद स्थान निकालने के लिए std :: ws का उपयोग करें:

  int a; Cin & gt; & gt; ए; Cin.ignore (std :: numeric_limits & lt; std :: streamsize & gt; :: max (), '\ n'); // जब तक कि नई लाइन नहीं मिल पाती / // मेरी विधि: cin.sync (); // अपठित अक्षर स्ट्रिंग त्यागें; गेटलाइन (पिन, एस); // नई लाइन चली गई है, इसलिए यह अन्य विधि को निष्पादित करता है: गेटलाइन (cin & gt; & gt; ws, s); // सभी प्रमुख सफेद स्थान निकालें  

How to find old wikipedia dumps -


I need access to a very old Wikipedia dump in French (Wikipedia's backup). I am successful in finding backups from archive.org 2010, and now I am searching for 2006 or earlier I know that the latest dumps have all the data from the previous ones, but I have to install a version of Wikipedia in my computer Because this example was in 2006,2010,2012. One thing - I think - it's impossible to do with the latest dump.

Thank you very much for your help.

Fixed HTML dump appears since November 2006, available here:

its In addition, if you get a full dump (with editing history), you can filter it by removing all the modifications after a certain date - then you should be able to see it as the date (later The material has been removed, and therefore not in the dump).


delphi - How do I find the index of a record in a TList? -


I am trying to increase the number of times I use each product code in my database. Being a problem, I do not know all the code (or more can be added).

I can use a TList with'm assuming that I have value added to it (Utpadkod and counting) something like this (I like to have a list & lt treatment Trying;;> C # to etc.)

  process myProc type TProductCodeCount = record ProductCode: string; Count: integer; End; Var Product Codes: TLIST & LT; Tputcodecountain & gt;; NewProductCodeCount: TProductCodeCount; CurrProductCodeCount: TProductCodeCount; CurrentProductCode: string; ProductCodeIndex: Integer; Start ProductCode: = TList & lt; TProductCodeCount>. Create; // Set your data // Turn on the loop through my data set CurrentProductCode: = // value from the database; ProductCodeIndex: = productCodes.indexOf (Current ProductCode); If productCodeIndex = -1 then the new ProductCodeCountor. ProductCode starts: = currentProductCode; NewProductCodeCount.count: = 1; ProductCodes.Add (newProductCodeCount) and start currProductCodeCount: = productCodes.Extract (productCodeIndex); CurrProductCodeCount.count: = currProductCodeCount.count + 1 ProductCode Delete (productCodeIndex); ProductCodes.Add (currProductCodeCount); End of end; // Start the loop through my TList / do something with each product and edit and end the end;  

Here are two big things wrong.

  1. me how to do that than work index is sure to work (if it is possible a TList of a record type
  2. Update list items unsightly

How can I compare? Or there is a better way to accomplish this

if you have TList & lt will pass the custom comparer can use ;? T & gt; Works

  Type TProductCodeCountComparer = class (TComparer & LT; TProductCodeCount & gt;) in the public function (const Left, Right: TProductCodeCount) :. Integer; override; end; function TProductCodeCountComparerkCompare (const Left, right: TProductCodeCount): integer; begin Result: = comparison (Baankutpadkod, right. Prodktkod); end; var Tulnar: Aisiompiyrr; Teepeedatakodkount & gt; Tulnar = Tiprodktkodcoint Comprer. Create; Utpadkod = Tielaisti & lt; Tiprodktkodkount & gt ;. (c omparer);  

Tulnakrta in as luggage can also create

  productCodes: = TList & lt; TProductCodeCount>. Create (Tikanpprr & lt; TProductCodeCount & gt ;. Constrkt (function (const left, right: TProductCodeCount): begins int result = compare (Baankutpadkod, right. Utpadkod); end));  

You can use the edit record in place TList & LT; T & gt; .List is the property that gives you direct access to TList & lt built-in, T & gt; The array enables modifying the record directly in the list:

  var productCodes: TList & lt; TProductCodeCount> .... inc (productcodes.list [productCodeIndex]. Count);  

TList & LT; T & gt; .List The property was introduced in XE3, class extension following record modifications for the first Delphi versions:

  TXList & lt; T & gt; = Square (TList & lt; T & gt;) Protected Type PT = ^ T; Function GetPItem (Index: Integer): PT; Public Property PItems [Index: Integer]: Read GetPItem PT; End; Function TXList & lt; T & gt; .GetPItem (index: integer): PT; Start the result: = @fights [index]; End; Var Productcode: TXList & lt; TProductCodeCount> .... inc (productCodes.PItems [productCodeIndex]. Count);  

php - how to input elements instead of another array, into end of array? -


Due to poor DB designs, the columns in each row can have multiple values ​​in the table. So I had to take every string, check if comma exists (multiple values) & amp; Place each element at the end of an array.

Try a function like struts, blast, array_push etc. With the Folllowing Code, how many elements do I input at the end of the array without any other & amp; By placing in an existing array?

  $ test = array (); $ Test = array ("test"); $ Str = 'a, b, c, d'; $ Parts = explosion (',', $ str); Array_push ($ test, $ portion); // Another array that was inserted in the $ test, which I do not want print_r ($ test); Use  

array_merge.

  $ test = array_merge ($ test, $ parts);  

Example:


Looping in Javascript array -


I have a simple query and I'm not sure why the array content is not returning properly. I'm pretty sure this is something easy, but in some way I can not find the result. The scenario is that a variable "comparison" is set to a value eg. "Apple" and I am looping in the array, and, if the SafeMe matches the text field with an index print. It does not do this and it always says "not equal" value, it works for the dog, it looks like it reaches the final array, then compares. help please.

The code below

   

  function print (msg) {document.getElementById ("demo") .innerHTML + = msg + '& lt; / Br & gt; '; } Function myFunction () {var text = ""; Var i; Var arr = ["apple", "banana", "carrot", "dog"]; Var comparison = document.getElementById ('compare'). value; If (compare!) {Print ('comparison is empty'); Return; } Other {print (compare with 'comparison'); } (I = 0; i & lt; arr.length; i ++) {if compare (ARE [I] ==) {Print ("value is on index" + + "is" + AR [I]); Return; // found out, break out for loop) and if (arr [i]! = Compare) {print ("not the same"); } Other {print ("some error"); }} Print ("" + Comparison + "in Array"); }  
  & lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Body & gt; & Lt; Script & gt; & Lt; / Script & gt; & Lt; P & gt; Click on the button to loop one with a break. & Lt; / P & gt; & Lt; Input type = "text" id = "compare" placeholder = "compare" /> & Lt; Button onclick = "myfunction ()" & gt; Try it & lt; / Button & gt; & Lt; P id = "demo" & gt; & Lt; / P & gt; & Lt; / Body & gt; & Lt; / Html & gt; For performance reasons it is better to validate the value of the first  comparison  before looping starts. You can break the loop by using the  break ,  continue  or  return  keywords. 


Specific type of URI Security Token in .NET -


I'm looking at a third-party app in .NET and I'm trying to figure out which method Uses a URI Security Token

The page URL looks at something like this:

  example.com/app/I (4b16emg) / account /  

Here the use of explicit protection in tokens (prevents attacks of XSRF and other types of session fixation and token theft). I'm not a hard core. Dev dev Maybe this is an underlying feature, because I'm pretty sure I have seen it before, but for that I have a hard time because I'm not sure what to say to him.

"Security token URI" and things like such inquiries do not seem very much.

Update with more information:

Any such session token to be used in addition to the session_id cookie to authenticate the session It appears that it takes a cycle for all new sessions and incorrectly ends its session and session also resets cookies, it is not related to user name or user_id value.

In this way, it depends on stabilizing vulnerability scans, replays attacks, session tokens theft, XSRF, reflected XSS and other similar attacks, to provide the injection points.

This is probably the second or third time in which I have seen the same format (a small token in the legs) between a URL in a format, so I was hoping someone would have given it a part of the structure In the form, or easily accessible library can be identified.

A bit of background: I do a lot of security applications, but .NET is not my feature.

This url looks like this is a security when the app's cooked sessions are current. Is less than the feature, and there is a way to deal with browsers that do not support / allow cookies.

The Web In configuring, see if the & lt; SessionState is cookieless = "true" />


Parse a file with lists in Haskell -


I am trying to read a file. The title is read correctly, but when I try to read the cast (actor) it seems that it does not have to stop and search. Is there any mistake in analyzing the percing or chairs to actors? Type type = type = string type actor = string type cast = [actor] type year = int type fan = string type fan = [fan] type period = (year, year) type

  = Database = [movie] Type movie = (title, cast, year, fan)  

- Parsing methods to read the file

  Parcelons :: [String] - & gt; Film Parcelains list = (list !! 0, parsectors (drop 1 list), read (list 2!), Parsectors (drop 3 list)) parsfains :: [string] - & gt; Fan parsfence [] = [] parsfans list | Length list & gt; 0 = [(list !! 0)] ++ Parsefance (drop 1 list) parseActors :: [string] - & gt; Cast Parsectors [] = [] Parsactors list | Length list & gt; 0 = [(list !! 0)] ++ parseActors (drop 1 list) parseChars :: string - & gt; String - & gt; [String] Pars Chairs [] _ ​​= [] Pars Chars (X: X) string coat | X == ',' = [stringCount] ++ Pars Chas X "" | | Otherwise = (Pars Chas x (string quote ++ [x])) Pars all :: [string] -> [Movie] Pars all [] = [] Pars all (x: x) = parcelenus (purse char x ""): (pars all xs)  

and I get this error < / P>

| Gunman | | | Idris Alba, Sean Penn, Javier Bardem, 2015, Gary, Dave, Jo, Kevin, | * Main> *** Exception: prelude.read: no parse

This is my text file

  The Gunman, Idris Alba, Sean Penn, Xavier Bard, Jo, Gary, Kevin, Olga, Liz, The Dark Knight, Christian Bale, Heath Ledger, Bard, 2015, Gary, Dave, Zoe, Kevin, Emma, ​​Shoshank Redemption, Tim Robbins, Morgan Freeman, Bob Gunton, Aaron Echert, 2008, Zoe, Heidi, Jo, Emma, ​​Liz, Sam, Olga, Kevin, Tim, Institution, Leonardo DiCaprio, Ellen Page, 2010, Jo, Emma, ​​J. , Olga, Kevin,  
  parsectors :: [string] - & gt; ; Cast Parsectors [] = [] Parsactors list | Length list & gt; 0 = [(list !! 0]] ++ parseActors (drop 1 list)  

Have you tried to see what this does?

  GHCi> ParseActors ["one", "two", "three"] ["one", "two", "three"]  

what you have done It is a very complex version:

  Parsactors :: [String] -> Cast Paras Actors list = list  

Similarly,

  parsfains :: [string] -> fan parsefance [] = [] parsfains list | length list & gt; 0 = [(list !! 0]] ++ parseFa Ns (drop 1 list)  

This code is similar to parseActors , you have just changed the name parseFans and the type of result < Code> fan . It behaves in the same way:

  parseFans :: [string] -> list of fans = list  

I am going to move forward and now I am ignoring the above. Instead, take parsa chairs for the spin.

  ghci & gt; Ah, such a function that actually parses me, I'm not sure how you work it. "A, two, three," "one", "two", "three"]  

Expect to do, but I think it is working as expected.

I want to draw your attention on this part of this parse line:

  reading (list !! 2)  

You are trying to do this and are using the year to get it. And this is what is throwing the error: preload. Read: no parse . Note that this tells you that the use of prelude.read is a criminal.

Okay. Let's take the first movie and run it through some of this code.

  ghci & gt; Gunmen = "The Gunman, Idris Alba, Sean Penn, Javier Bardem, 2015, Gary, Dave, Zoe, Kevin, Emma," Gachi & GT; List = Purs Charge Gunman "" GCA & gt; List ["The Gunman", "Idris Alba", "Sean Penn", "Javier Bardem", "2015", "Gary", "Dave", "Zoe", "Kevin", "Emma"] ghci & gt; List !! 2 "Seine Pen"  

Notice how list !! 2 year is not your problem is ok, one of them, anyway.

Then learn the lesson:

  • Use the interactive prompt (ghci) to test the fragment of your code and make sure that the way you Expect.
  • Filtering error messages, they can often give clues about what is wrong with your code.

python - pandas: plot multiple columns of a timeseries with labels. -


यह प्रश्न एक सटीक डुप्लिकेट है: < / P>

  • 2 जवाब

मैं अजगर में नया हूँ और पांडा.मैं अजगर पांडा का प्रयोग करके ग्राफ को आकर्षित करने की कोशिश कर रहा हूं। अब तक मैं SQL डेटाबेस को पढ़ने में सक्षम हूं। पीडी conn = sqlite3.connect ('demo.db') df = pd.read_sql ("एबीसी से चयन करें", conn) df.head ()

  आयात करें sqlite3 आयात पांडा कोड>  

मुझे इस आउटपुट को परिणाम के रूप में मिलता है यहाँ छवि विवरण दर्ज करें

यहां समय टिकट केवल एक वर्ष के लिए है मैं सभी प्रकार के लिए लाइन ग्राफ़ (वर्ष बनाम मान) साजिश करना चाहता हूं।

मदद के लिए धन्यवाद

टाइमस्टैम्प को डेटाइम में परिवर्तित किए बिना आप सिर्फ एक प्लॉट कॉल करते हैं <प्री> पीलाब आयात से * आयात करें पंडों को पीडी आयात के रूप में आयात करें sqlite3 # लोड हो रहा है आपके डेटाफ़्रेम में viy वर्तमान कोड conn = sqlite3.connect (' Demo.db ') df = pd.read_sql (' SELECT * FROM ABC ', conn) # अपना प्लॉट अंजीर = आकृति (figsize = (6.5,3.5)) ax = fig.add_subplot (111) ax.plot (df। टाइमस्टैम्प, df.Value) ax.legend (('मान'))

अब वास्तविक प्रश्न यह है कि आप अपने टाइमस्टैम्प के साथ क्या कर रहे हैं? एडचुम ने पहले से ही समझाया है कि डेटैट में कैसे कन्वर्ट करना है, लेकिन आपके डेटा को देखकर मुझे लगता है कि आपके पास केवल एक अद्वितीय टाइमस्टैम्प मान है, इसलिए यदि आपका एक्स-एक्स का समय है तो बाकी सब के ऊपर स्टैक्ड होगा हालांकि, यदि आप वास्तव में एक समय बनाम मूल्य प्लॉट करना चाहते हैं (आप इसे इंगित करते हैं, लेकिन मैंने आपको गलत टाइप किया है) तो इससे अधिक समझदारी होगी और आपको df.TimeStamp और df.Value को ax.plot आदेश में स्विच करना होगा ऊपर।


Can <sitemapindex> contain <sitemap> that contains another <sitemapindex>? -


Can I add a sitemap that contains sitemapindex?

For example:

sitemapindex.xml contains

  & lt; Sitemapindex & gt; & Lt; Sitemap & gt; & Lt; Loc & gt; La.example.com/sitemap.xml< / Loc & gt; & Lt; / Sitemap & gt; & Lt; / Sitemapindex & gt;  

is included in sitemap.xml

  & lt; Sitemapindex & gt; & Lt; Sitemap & gt; & Lt; Loc & gt; La.example.com/post1.xml.xml< / Loc & gt; & Lt; Loc & gt; La.example.com/post2.xml.xml< / Loc & gt; & Lt; Loc & gt; La.example.com/post3.xml.xml< / Loc & gt; & Lt; / Sitemap & gt; & Lt; / Sitemapindex & gt; For example, all posts in sitemapindex1 will be included, sitemapindex2 will have all tags, and so on .... 


c++ - Using FFMPEG libs to UDP stream mpeg2 ts video delay / initial connection problems -


Currently some MPEG 2 tex (H.264 encoded) videos are using Lib F with FFPMEG. Streaming is done through UDP multicast.

The issue I am currently having is the two main things. I have got a long time to have the initial connection time / video to show (the stream also includes metadata, and this stream is my media Tool is detected instantly)

Once the video runs, it gets cured, but the timing of that initial connection is always delayed.

I am trying to be near streaming live as much as possible.

Currently using av_dict_set (& dict, "tune", "zerolatency", 0) and "profile" -> "base line" option.

GOP size = 12;

First of all I thought that this problem was a frame issue, but the initial delay is if gopsize is 12 or the default is 250. Sometimes the video will be connected quickly, but it is dropped immediately, there is a delay, then it starts back and is good at that point.

According to the documentation, to limit initial synchronization delay, the zero latency option should be sent to multiple frames.

I started thinking about the issue of a buffering type, such as when I close the application and release the media player, it progresses fast till it does not run basically Where file streaming is turned off.

So when I do not fully understand what was wrong, then at least The problem was fixed.

This issue came from av_write_interleaved_frame () versus regular av_write_frame () (this works for a live streaming), when writing video frames. In order to fully understand the sick, you have to slip a bit in the gap, but sometimes it is funny how you understand the whole problem after pushing your face for a few days.

I can streaming a very good live ish video with the tune "Zirollancy" option set.


c# - .*? does not match character before word boundary -


मुझे समझना मुश्किल है कि क्यों ((? I) \ bb। *? \ B) स्ट्रिंग a b-c के लिए b और b - नहीं देता है। मैंने ((? I) \ bb \ w * \ b) की भी कोशिश की, लेकिन इससे कोई बेहतर काम नहीं किया गया।

कुछ और जानकारी:

मुझे एक टेक्स्ट में शब्दों का मिलान करने की आवश्यकता है मुझे उन सभी शब्दों को पुनः प्राप्त करने की आवश्यकता है जो अक्षर b से शुरू होते हैं। और 'शब्द' का मतलब किसी भी अक्षर की स्ट्रिंग है जो b से शुरू होती है, जैसे b , b - , b ' / कोड>, b " आदि। 'शब्द' मुझे मैच की ज़रूरत नहीं है, उदाहरण के तौर पर अंतरिक्ष के साथ सीमित नहीं हैं।

इससे आपको वांछित परिणाम देना चाहिए:

(b। *?) (?: \ S | $)

मैंने इसे a b-c bfdf b32 = "dfa b पर परीक्षण किया है। बी --- एस एडी बी । ऐसा लगता है कि आप शब्द की तलाश नहीं कर रहे हैं, लेकिन किसी भी स्ट्रिंग की शुरुआत से "बी" एक स्थान से सीमांकित (या अन्य?) चरित्र (ओं) आपका मूल पैटर्न काम नहीं कर सकता क्योंकि "-" किसी शब्द के भाग के रूप में योग्य नहीं है शुभकामनाएं।

ध्यान दें: उपरोक्त पैटर्न बहुत सरल है, $ के साथ आखिरी भाग है, ताकि आखिरी "बी" कैप्चर किया जाता है जो कि लाइन के अंत में है।


c++ - How to create new GMimeMessage from string? -


In my project I use libgmime for MIME types. I am trying to create a new GMimeMessage by using std :: string as a body. According to Docs, this data can be made using GMimeStream and GMimeDataWrapper , and then MIME to GMimePart with this data The new message can be set as part. Code:

  std :: string body = "some test data"; GMimeMessage * message = g_mime_message_new (FALSE); // set header g_mime_object_set_header ((GMimeObject *) message, name.c_str ()), value.c_str (); // Create the stream and write the data in it. GMimeStream * Stream; G_mime_stream_construct (stream, 0, body.length ()); G_mime_stream_write_string (stream, body.c_str ()); GMimeDataWrapper * wrapper = g_mime_data_wrapper_new_with_stream (stream, GMIME_CONTENT_ENCODING_DEFAULT); // GMimePart to set GMimeMessage as the mime part of GMimePart * mime_part = g_mime_part_new (); G_mime_part_set_content_object (mime_part, wrapper); G_mime_message_set_mime_part (Message, (GMimeObject *) mime_part);  

When I try to create a message like this, I get a segment here:

  g_mime_stream_write_string (stream, body.c_str () );  

Maybe I'm using the wrong method of messaging ... can this be done correctly?

You have bad initialization GMimeStream * stream . Requirement:

  GMimeStream * stream; / * Start GMIM * / g_mem_init (0); Create a stream around / * Stdout * / stream = g_mime_stream_mem_new_with_buffer (body_part.c_str (), body_part.length ());  

View document: and sample:


Shell Scripting passing arguments to a system binary and storing the value -


I was trying to work it on some occasions, but I think there is a slight problem.

Asterisk-RX "Core Show Call" | | Grep "active" | Cut-D '' -f1

Execute command, runs from / usr / sbin / asterisk , launches it equally, makes executable executable Pipes out the output and, for the active call, grep generally receives an integer value, which I want to store in one variable and continue to make the script work from there.

I have been given a hard time for command.

I basically try to make that command in a shell script and store the value.

Can you point me towards the right direction?

about it:

  active = $ (esteqik-rx "Core show call" | Ajax '$ 2 ==' active "{N = $ 1} END {printf ("% d ", n)} ')  

To ensure this For awk uses printf , if the active call line is left in your output, your variable is assigned 0 instead of blank.

Or alternatively, if you have a shell bit, you can use it to avoid all pipes:

  read active _ _; If ["$ what" = "active"]; The breaker then & lt;  

At the end of this loop, if no "active call" lines were observed, then $ active is empty If you want, you can add:

  active = $ {active: -0}  

to specify a zero value If someone is not active call is reported.

(In my tests, 0 active call reports with each run, so this blank handling is just insurance.)


vsts - OpsHub TFS to VSOnline Migration Utility - Will WorkItem # not stay the same? -


We are migrating various projects from on-premises to VS Online using opshb migration tool.

I see that the work item number does not match the same work item number in the on-premises VSO. Whether by design, or am I using the device wrong?

If not, then what is the way to maintain work item numbers?

Worksheet # is an auto-generated field in VS Online, ophb migration tool does not migrate them . Oppsb starts the migration of the operating system in parallel to the workgroup type (bug, test case, etc.). There is no guarantee that the workitem # will be similar in both points.


cassandra bulk loader database descriptor null pointer exception -


I am trying to follow the example of loading the bulk of the new and the following blog Cassandra:

If I use the provided jar and runs the example, then it works.

I, instead, provides the use of the source file (and the resulting jar when I try to run this error:

  exception in thread "main) org.apache.cassandra on "java.lang org.apache.cassandra.cql3.statements.UpdateStatement.addUpdateForKey (UpdateStatement.java:109) org.apache.cassandra.io.sstable.CQLSSTableWriter.rawAddRow (CQLSSTableWriter.java:218) on .ExceptionInInitializerError .io.sstable.CQLSSTableWriter.addRow org.apache.cassandra.io.sstable.CQLSSTableWriter.addRow (CQLSSTableWriter.java:113) to (CQLSSTableWriter.java:138) on bulkload.BulkLoad.main (BulkLoad.java : 145) was caused by: java.lang.NullPointerException at org.apache.cssandra.config.DatabaseDesc org.apache.cassandra.db.Keyspace on riptor.createAllDirectories (DatabaseDescriptor.java:605). & Lt; clinit & gt; (Keyspace.java:73) .. 5. More  

I have not changed anything from the example in the file. I had assumed that it would have the correct result in running the jar file provided in the same example, but it did not happen. Can anyone explain what I did?

Thank you.

What versions of cassandra do you use? Example was written with 2.1 in mind.

can set client mode config are

  org.apache.cassandra.config .Config.setClientMode (right); Otherwise you may have problems with the database with the database that have been statically declared, you can probably put a fake case in your square path, and you can work around them. , Which I think is cassandra-providing all the packages for example. 

It is notable that in all the possibilities, it will perform better than inserting you directly instead of trying to bulk load.


mysql - Overcome limit when silect into @ text variable in stored procedure -


I am trying to select group_concat in variable @s

In this process I use The data for 'results' in column is too long, but this is an error

Error code:> SET session group_concat_max_len = 4294967295; SET @ query = CONCAT ('SELECT GROUP_CONCAT (\' & lt; url & gt; & lt; loc & gt; https: //www.example.com/product/ \ ', seo_url, \' .html & lt; / Loc & gt; & lt; / url & gt; \ 'SEPARATOR \' \ r \ n \ ') FROM', @ cpy, 'products WHERE web_vis_each OR web_vis_pair group_ID by ORDER, status, make, model;'); - Prepare sql_query from @query; EXQUTE sql_query;


UPDATED - PHP Fetch Associative Array - Selecting Multiple Rows from MySQL DB -


Currently, I'm able to choose a line of data from my database table. I was thinking that every time it is possible to select information from a particular line without changing the code according to your needs. This is for a news article on my website.

Here's my code:

  & lt ;? Php session_start (); If (! $ _ Session ['username']) {header ('location: index.php'); } 'Connect.php' is required; $ Tbl_name = 'news'; $ Sql ​​= "SELECT id, title, description, content $ tbl_name ORDER id id ECCCL3"; $ Article = array (); $ Result = mysqli_query ($ conn, $ sql); $ Line = mysqli_fetch_array ($ result, MYSQLI_ASSOC); Printf ('& lt; p class = "sidenav" & gt; 1. & lt; a href = "../ news.php? Article =% o" & gt;% s & lt; / a & gt; Lt; / p & gt;, $ line ["id"], $ line ["title"]); ? & Gt;  

Now, as you can see, I have selected 3 rows, how can I get data from more than one row? Currently, if I have more than one line, then this will not output anything to specific id ?

Update: What is a way to indicate certain information without specifically selecting a line, but what if I have more than one Want to print?

  $ result = mysqli_query ($ conn, $ sql); While ($ row = mysqli_fetch_array ($ result, MYSQLI_ASSOC)) {printf ('& lt; p class = "sidenav" & gt; 1. & lt; a href = "../ news.php? Article =% o" & Gt;% s & lt; / a & gt; & lt; / p & gt; ', $ line ["id"], $ line ["title"]); Printf ('& lt; p class = "sidenav" & gt; 2. & lt; a href = "../ news.php? Article =% o" & gt;% s & lt; / a & gt; Lt; / p & gt;, $ line ["id"], $ line ["title"]); Printf ('& lt; p class = "sidenav" & gt; 3. & lt; a href = "../ news.php? Article =% o" & gt;% s & lt; / a & gt; Lt; / p & gt; ', $ line ["id"], $ line ["title"]);  

Please help!

  $ result = Mysqli_query ($ conn, $ sql); While ($ row = mysqli_fetch_array ($ result, MYSQLI_ASSOC)) {printf ('& lt; p class = "sidenav" & gt; 1. & lt; a href = "../ news.php? Article =% o" & Gt;% s & lt; / a & gt; & lt; / p & gt; ', $ line ["id"], $ line ["title"]); }  

python - Compare 2 strings issue -


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

  • 3 जवाब

मेरे पास मेरे ब्लॉक elif अंदर एक लूप जिसमें 2 स्ट्रिंग्स (अक्षर) की तुलना होती है, लेकिन भले ही मैंने सही अक्षर डाल दिया हो, फिर भी यह लूप चलाता है .. मैं फ़ोरम के माध्यम से देख रहा हूं, कई चीजों की कोशिश की, लेकिन यह अभी भी पाश चलाने में मुझे पता नहीं क्यों ।

<पूर्व> एलीफ़ वॉलेट & gt; 0: # यदि खिलाड़ी अभी भी खेलना चाहता है (यदि बटुआ खाली नहीं है) restartp = raw_input ('[y / n] चलाते रहें?') जबकि restartp! = 'Y' या restartp! = 'N': प्रिंट '[! ] गलत जवाब !' अगर restartp == 'y': restart = 1 elif restartp == 'n': restart = 0 रखें = गलत

restartp! = 'Y' या restartp! = 'N' हमेशा सच हो जाएगा

आप इसके बजाय उपयोग कर सकते हैं:

  restartp! = 'Y' और restartp! = 'N'  

या वैकल्पिक रूप से: < / P>

  जबकि restartp नहीं में ('y', 'n'):  

How to create C# Bitmap supporting PropertyItems from existing Image (from Camera) -


I am creating a C # image from the camera. I want to create an image that supports property items from this image so that I can include audit-level details in meta-data.

The image created by the camera does not support the item's etams, and so I want to make anyone who does with the current image, ideally it should be lossless, and should be fast.

Example I have seen that images supporting these meta-data attributes arise from reading the image from a file, and not already in any of the in-memory

Are there any recommendations for this?

Note that I am avoiding using a class containing, or the derived image class, due to issues of at least integration.

I mean "Creating a C # image from camera" means "you" means that someone Creating a JPEG image created by the camera in the C # image is the object "?

The property of an image object allows you to do this, even if your camera does not contain such data either. If you open the image (JPEG), set the property and save it back if you do not edit the image bitmap manually State believes that it will be saved in the (compressed) format.


c++ - "Downcasting" unique_ptr<Base> to unique_ptr<Derived> -


I have a series of several factories which unique_ptr < Base & gt; Under the hood, however, they have different derivative types, such as unique_ptr & lt; Derived & gt; , unique_ptr & lt; DeriveA & gt; , unique_print & lt; DerivedB & gt; etc.

Code given: Derived and Derived: Base We have:

  unique_ptr < Base & gt; DerivedAFactory () {Return Unique_Reference & lt; Base & gt; (New DeriveA); }  

Whatever I need to do is return to unique_ptr & lt; Base & gt; At some derivative level (essentially not the original internal one) from . To pseudo-code:

  unique_ptr  unique_ptr , then using a function that leaves the raw pointer and any other Code> re-assigns the unique taste of : 

  unique_ptr to the desired taste ( release  will be done explicitly by calling the caller) & Lt; Derived & gt; CastToDerived (Base * Obj) {Unique IPTR & Lt; Deleted & gt; (Static_cast & lt; Derivative * & gt; (OBJ)); }  

Is it legal, or is there something funky to do?


PS has an added complexity that some factories live in DLLs that are loaded dynamically in run-time, which means that I need to make sure That the finished products were destroyed in the same heap (space) because they were made. Transfer of ownership (which is usually in any other context) then a deliverter must be provided from the original context. But in addition to providing / delivering a delivery with the pointer, the casting problem should be the same.

I have some function templates, static_unique_ptr_cast and Dynamic_unique_ptr_cast Use them in earlier cases where you are absolutely certain that the indicator is actually a derived * , otherwise use later.

  template & lt; Typename derived, typename base, typename dell & gt; Std :: unique_ptr & lt; Derived, Del & gt; Static_unique_ptr_cast (std :: unique_ptr & lt; base, del & gt; & amp; amp; P) {autoD = static_account & lt; Derivative * & gt; (P.Relize ()); Return std :: unique_ptr & lt; Derived, Del & gt; (D, std :: move (p.get_deleter ())); } Template & lt; Typename derivative, typename base, typenamename & gt; Std :: unique_ptr & lt; Derived, Del & gt; Dynamic_unique_ptr_cast (std :: unique_ptr & lt; base, del & gt; & amp; amp; amp; amp; amp; amp; amp;; p;) (if (concluded * result = dynamic_costs & lt; generated * & gt; (p.get ()) {p .release (); Return std :: unique_ptr & lt; Derived, del & gt; (Results, std :: move (p.get_deleter ())); } Return std :: unique_ptr & lt; Derived, Del & gt; (Nullptr, p.get_deleter ()); }  

To get this work done, a rvalue is referencing that you get theft unique_ptr from below the foot of the collar was done.


dependency injection - Autofac DependencyResolver of same service with 2 different services -


I have a service with two separate components

  & lt; Component Type = "Concrete A, Concrete A" Service = "Interface, Interface" /> & Lt; Component Type = "Concrete, Concrete" service = "Interface, Interface" />  

I want to solve both of them. I am trying this way

  var builder = new containerbuilder (); the creator. Registration Manager (new configuration reader); Builder.RegisterControllers (typeof (MvcApplication) .asembly); this. _ Container = Builder. Build (); Dependance Resolver. SetsSolar (New AutoFacDirection Resolver (it._container));  

Now in my controller I want to solve my dependency

  public interface _myInterface {get; Set; }  

And I use it this way:

  _myInterface.DoWork ();  

If I declare only one component in the conference, then everything works perfectly. But if I add more component of the same interface type, then something goes wrong I

  public list & lt; Interface & gt; With the attempt to change the declaration of property. _myInterfaces {get; Set; }  

But the property always remains ... How can I do this?

Thanks

the solution

  public Interface [_] _myInterfaces {get; Set; }  

instead of

  public list & lt; Interface & gt; _myInterfaces {get; Set; }  

ios - uia action failed because: Timed out running command uia.tapOffset -


After

I am facing some random errors when my Calabash test is running and trying to touch the element

UIA operation failed because: the timeout order started running uia.tapOffset ('{: x 187.5, y 131.5}')

I have a trial going on < Strong> Yosemite , Xcode 6.2 and iOS Simulator (iPhone 6 iOS 8.1)

version of Kailash 0.13 .0 . .

Do anyone know why this is happening and how to fix it?

update

when I say "randomly" means that sometimes the test pass passes and sometimes fails with this error Once I've just checked and after entering some text in the text field, it is always failing when trying to tap on the tabs tab. So my guess is that the keyboard is still there when it is trying to touch the tab button

For your information, this is the method that is created for me to enter text

  def type_text (accessibilityLabel, text) query = "text field accessibilityLabel: '# {accessibilityLabel}' 'until safe_query (query) return first [" text "] = text wait_for_ui_animation_to_end safe_touch (query) map (Query,: setText, '') map (query, settext, text) done  

and these are safe_touch and safe_q Uery Methods I use

<> def safe_query (query) wait_for pre (: timeout = & gt; 60, timeout_message = & gt ;, "expired # {query} Try_time_industry => true_type (query): query_exists (query) end query tax (query) end def safe_touch (query) wait_for (: timeout => 60, timeout_message = & gt ;, "time End {query} # Trying to touch ": screenshot_on_error = & gt; true) tax element_exists (query) end touch (query) end

update 2

Here is an example of the scenario Too-sometimes fails

enter image details here

Screenshots of the screen are here if the test fails

It does not seem like when trying to tap the tabbar item ...


SQL 2008 cumulative count -


I have a query that returns the number of grouped rows by date:

  SELECT Convert (date, run.TimeStamp) as the timestamp, count (*) join the Race Insert as ScriptResult run ScriptRun form run.ScriptRunID = res.ScriptRunID interiWorkListItems as wli on wli.WorkListItemID = res .WorklistItemID Join InsLine WorkList Join WL as WL .WorkListID = wli.WorkListID Where (wli.WorkListID = @WLID) changed by group (date, Run.TimeStamp) order by converting (date, run.TimeStamp);  

This generates a result set like this:

  Timestamp (Madcount) 2015-03-10 5364 2015-03-11 22027 2015- 03-12 18037  

Now what I want, cumulative ITEMCOUNT to summarize, is like this:

  timestamp ITEMCOUNT TOTALCOUNT 2015-03-10 5364 5364 2015 -03 -11 22027 27391 2015-03-12 18037 45428  

The query should be compatible with 2008R2. I have played in many variations [count ... more than ... division] but the problem is that the window function limit was needed. And I can not use ROWS or RANGE.

Any thoughts please? Thanks in advance

Try the correlated subquery:.

 ; With the form of CTE (change the timestamp as (date, run.TimeStamp), run on the run.criptRunID = res.ScriptRunID interiors on the wli.WorkListItemID = ResWliListItems join the form as Run ScriptResult Race Insiders Join ScriptRun as Count (*) S. WorklistItemID Change interiors (date, run.TimeStamp)) Select Timestamp, S, (select s) by WorkList as wL.WorkListID on WL = Wli.WorkListID Where (wli.WorkListID = @WLID) join group CTE T2 Where T2 with .t Imstamp & lt; = t1.TimeStamp) from T to CT T1  
)

spring - Property sources order in PropertySourcesPropertyResolver -


यह मेरे कॉन्फ़िग क्लास का एक हिस्सा है:

  @ कॉन्फ़िगरेशन @ प्रॉपर्टी सोरस ("क्लासपाथ : Properties.properties ") सार्वजनिक वर्ग DataBaseConfig {@Resource निजी पर्यावरण env; @ बीन सार्वजनिक डेटा स्रोत डेटा स्रोत () {DriverManagerDataSource dataSource = नया DriverManagerDataSource (); // कुछ गुण स्ट्रिंग उपयोगकर्ता नाम = env.getProperty ("उपयोगकर्ता नाम") हो रहा है; dataSource.setUsername (उपयोगकर्ता नाम); वापसी डेटा स्रोत; }}  

समस्या यह है कि SystemEnvironmentPropertySource में "उपयोगकर्ता नाम" संपत्ति भी शामिल है, और यह मेरी संपत्ति के आधार पर ResourcePropertySource से पहले संसाधित हो रही है फ़ाइल, संपत्ति स्रोत सूची आदेश के कारण इसलिए "उपयोगकर्ता नाम" संपत्ति का गलत मान लोड होता है। सिस्टम वातावरण गुणों के समक्ष संसाधित करने के लिए फ़ाइल में प्रॉपर्टी प्राप्त करने का तरीका क्या है?


php - Regular Expression to catch a sequence of letter and digit but containing minimum 3 letters ? how to do? -


I have to make a regular expression in PHP which captures a text that contains the string in which only uppercase letters, numbers, or Underscores are. Example: THIS_STUFF , THIS_2_STUFF , ONE_MORE_STUFF_2_CATCH etc ... This works well with: / [A-Z0- 9_] /

However, I want to capture those sequences which are only:
- Minimum 5 characters ==> / [A-Z0- 9_] { 5,} /
- And with minimum 3 uppercase letters ==> ????

Do you have any ideas?

Thank you!

and with minimum 3 uppercase letters ==> ????

Use at the beginning of this.

  ^ (? = (?: [^ Az \ n] * [az]) {3}) [A-Z0- 9 _] {5,} $  < / Pre> 

OR

  \ b (? = (?: [^ AZ] * [as]) {3}) [A-Z0-9_] {5,} + \ B  


Android SDk can't download with failed to fetch URL -


I download Android SDK, when I open it, I can install SDK 21.

But now it does not work and some error:

Failed to fetch the url link: dl.google.com/android/repository/repository-10 .xml, Reason: SSLPeerUnverified peer is not authenticated

But when I get Chrome I link: dl.google.com/android /repository/repository-10.xml.

I have set "force brought using http: //", and I use Goagent to install.

tool-> option-> try for force ...


delphi - Filtering more than one record in database table throws up syntax error/access violation -


Using Delphi XE2.

I have a database software package that shows a record from a table on a cxgrid. I have implemented a filter button with one click, allowing users to search for results using specific records. At the moment it works only when 1 out of records is selected, it is not liked, when more than one filter record is selected, it displays the following error .... 'syntax error or access violation : Pass' and 'more in']. The following code is what I am doing when I click on the filter button.

Any help would be greatly appreciated.

  Start with DMDITA. SQL.Clear; SQL.Text: = ('Choose * from DBA.RECORDS'); If dbluCaseCategory.Text & lt; & Gt; '' So SQL Add ('where sort of category: category_type'); If dbluSubCategory.Text & lt; & Gt; '' Then SQL.Add ('and as sub_cat_type: sub_cat_type'); If dbluCustomer.Text & lt; & Gt; '' Then SQL.Add ('and customer_name like: customer_name'); If dbluUsername.Text & lt; & Gt; '' So, SQL.ad ('Made and Created Person: Like: Created' Person '); If cxStartDateEdit.Text & lt; & Gt; '' So SQL Add (like 'and log in: log-ddt'); If dbluCaseCategory.Text & lt; & Gt; '' Then Paramabine ('Category_type'). Value: = dbluCaseCategory.Text + '%'; If dbluSubCategory.Text & lt; & Gt; '' Then Paramabanam ('subcut_type'). Value: = dbluSubCategory.Text + '%'; If dbluCustomer.Text & lt; & Gt; '' Then the ultimate name ('customer_name'). Value: = dbluCustomer.Text + '%'; If dbluUsername.Text & lt; & Gt; '' Then the ultimate name ('made_by_user'). Value: = dbluUsername.Text + '%'; If cxStartDateEdit.Text & lt; & Gt; '' Then the ultimate name ('log in_date'). Value: = cxStartDateEdit.Text + '%'; Open; End; Close; End;  

Your code will only work if you include the first filter (dbluCaseCategory.Text). Because if you add where to the code on that code, then if you do not pass any value for dbluCaseCategory , then the last SQL Sentence will not be valid. To fix that just add a where 1 = 1 to the first sentence. As soon as. Stop dmData.aqry with

 ; SQL.Clear; SQL.Add (Select 'from DBA.records where 1 = 1'); If dbluCaseCategory.Text & lt; & Gt; '' Then SQL.Add ('and category_type like: category_type'); If dbluSubCategory.Text & lt; & Gt; '' Then SQL.Add ('and sub_cat_type like: sub_cat_type'); If dbluCustomer.Text & lt; & Gt; '' Then SQL.Add ('and customer_name like: customer_name'); If dbluUsername.Text & lt; & Gt; '' So, SQL.ad ('Made and Created Person: Like: Created' Person '); If cxStartDateEdit.Text & lt; & Gt; '' So SQL Add (like 'and log in: log-ddt'); If dbluCaseCategory.Text & lt; & Gt; '' Then Paramabine ('Category_type'). Value: = dbluCaseCategory.Text + '%'; If dbluSubCategory.Text & lt; & Gt; '' Then Paramabanam ('subcut_type'). Value: = dbluSubCategory.Text + '%'; If dbluCustomer.Text & lt; & Gt; '' Then the ultimate name ('customer_name'). Value: = dbluCustomer.Text + '%'; If dbluUsername.Text & lt; & Gt; '' Then the ultimate name ('made_by_user'). Value: = dbluUsername.Text + '%'; If cxStartDateEdit.Text & lt; & Gt; '' Then the ultimate name ('log in_date'). Value: = cxStartDateEdit.Text + '%'; Open;  

ios - How to avoid alphabet and special characters in a UITextfield? -


I have been formatted to a US mobile number Uaiteedefild.
I was displaying number format in the US, but it allows

I do not want to allow alphabet and special characters.
How can I avoid these unwanted characters?

Please give any examples.

Try it

  #define ACCEPTABLE_CHARACTERS @ "Do you want Replace with permission. " - (BOOL) Tekstfild should Tekstfild (UITextField *) Chenjrsctors Inrenj: (Ansarenj) range replacement string: (NSString *) string {NSCharacterSet * cs = [[NSCharacterSet characterSetWithCharactersInString: ACCEPTABLE_CHARACTERS] invertedSet]; NSString * filtered = [[Separated BearActers Inset: String components] componentsJoinedByString: @ ""]; Return [String Extolstration: Filtered];  

}


go - How do I access functions in the main package? -


सेटअप के अनुसार:

  $ GOPATH / github.com/ddavison/project/ सबपैकेज / Lib.go main.go  

lib.go

  पैकेज उपपैकेज ... func Hello () {fmt.Println ("हैलो")}  

main.go

  पैकेज मुख्य ... func main () {...} func DoSomething () {fmt.Println ("किया!  main.go  से  

, मुझे पता है कि मैं lib.go के कार्यों को कॉल करने में सक्षम हूं < / P>

  import "github.com/ddavison/project/subpackage" lib.Hello ()  

लेकिन मैं उलटा कैसे कर सकता हूं, कॉल करें main.go से lib.go से विधि? मैं DoSomething () से lib.go

जाओ के funtions प्रथम श्रेणी हैं फ़ंक्शन DoSomething को lib फ़ंक्शन के पैरामीटर के रूप में पास करें।

यदि कोई अन्य संदर्भ मुख्य संदर्भित करने के लिए अनुमति दी गई थी, तो आपके पास एक परिपत्र निर्भरता होगी।

lib.go

  पैकेज सबपैकेज ... प्रकार पूर्ण फंक () func हेलो (पूर्ण पूरा) {fmt.Println ("हैलो") पूर्ण ()} < / Code> 

main.go

  पैकेज मुख्य ... func main () {subpackage.Hello (DoSomethign)} func DoSomething () {fmt.Println (" किया! ")}  

c# - I have more columns that I want on my database with my EF Code First model -


I'm developing an Entity Framework code prior to 6.1.2 with the .Net Framework 4.5.1 and C #.

I have these two tables:

  public class code {public string code {get; Set; } Public at BATCH_ID {get; Set; } Get public byte CODE_LEVEL { Set; } Public byte COMMISIONING_FLAG {get; Set; } Public Virtual AGGREGATION_CHILDS Integration child {get; Set; } Public Virtual List & lt; AGGREGATION_CHILDS & gt; Aggregation child {receive; Set; } Public Virtual Batch Batch {get; Set; }} Public class AGGREGATION_CHILDS {public string CODE {get; Set; } Public string CODE_CHILD {get; Set; } Public At Position {Received; Set; } Public virtual code aggregation {received; Set; } Public Virtual Code Code {get; Set; }}  

and their unit framework map:

  class code configuration: EntityTypeConfiguration & lt; CODES & gt; {Public Code Configuration () {HasKey (c => c.CODE); Property (C => C.CODE). HASDatabaseGeneratedOption (DatabaseGeneratedOption.None); Property (C = & CO; CAWEEDE). Hasmaxleenth (20); Property (c => c.BATCH_ID) .IsRequired (); Property (C => C. CODE_LEVEL) .IsRequired (); Property (C = & gt; c.COMMISIONING_FLAG) .IsRequired (); HasRequired (c = & gt; c.batch) Together with many (B = & gt; B. Cds) .User's (C => C. BATHHID); }} Class AGGREGATION_CHILDS configuration: EntityTypeConfiguration & lt; AGGREGATION_CHILDS & gt; {Public AGGREGATION_CHILDSConfiguration () {HasKey (ag_ch = & gt; new {ag_ch.CODE, ag_ch.CODE_CHILD}); Asset (AG_C => ag_ch.CODE). Hassadabase Generated ops (Database Generation. Non); Property (AG_C => AG_CH.CODDCCHIL). HASMXLMDent (20) ISRAEFair (); HasRequired (ag_ch = & gt; ag_ch.Aggregation). With optical (c => c.AggregationChild); HasRequired (ag_ch = & gt; ag_ch.Code). Multiple (C => c.AggregationChildren). HesForeignKey (ag_ch = & gt; ag_ch.CODE_CHILD); }}  

I want to create these two tables with these relationships:

  Make Table [DBO]. [AGGREGATION_CHILDS] ([CODE] [Nvwarchar] (20) No, no [CODE_CHILD] [Nwarvcr] (20) No, no, [position] [Int], Contrastent [Pike_ AGGREGATION_CHILDS] primary key Clastr ([CODE] ASC , [CODE_CHILD] ASC), CONSTRAINT [FK_AGGREGATION_CHILDS_AGGREGATIONS] [key] [code]] references [code] ([cODE]), CONSTRAINT [FK_AGGREGATION_CHILDS_CODES] Create foreign key ([CODE_CHILD]) references [code] ([cODE]) table [DBO]. [code] ([cODE] [nvarchar] (20) nOT NULL, [BATCH_ID] nOT NULL, [CODE_LEVEL] [Tinyint] nOT NULL, [COMMISIONING_FLAG] [Tinyint] nOT NULL, constraint [PK_CODES] pRIMARY KEY Cluster ([code] ASC) int, constraint [FK_CODES_BATCHES] foreign key ([BATCH_ID]) References [DBO]. [Batches] ([id]))  

But I get it: Enter image details here

Any advice?

You can use the attribute Notmapped

will not create an area on DB.

Once a foreign key is declared, and the index field is used. You can control the foreign key field name or you .hasForeignKey (ag_ch = & gt; ag_ch.CODE_CHILD);

Do not forget that EB can use the EE power tool to reverse the first code to be engineered to DB. So if you have a simple DB sample you can make that code first.


ruby on rails - How to install the latest version of Carrierwave. Get's an year old version? -


I tried to install version 1.0 mentioned in the Readme file:

The form of In version 1.0.0, CareerWave requires Rail 4.0 or higher and Ruby 2.0 or higher. If you are on Rail 3, you should use v0.10.0.

Then I get an error by saying that gem 'carrierwave (= 1.0.0) ruby' in the gems available on this machine

In the Ruby Gems site, we also receive version 0.10.0 a year ago! Is there any other way to get a new version?

In the terminal, type gem install carrierwave -v 1.0.0 or Run the bundle if you want the version you want.


java - shifting Label in array of JLabel in swing -


I want to convert my elements into JLab label values, for example, depending on the textfield values, for example if I show my labels in 10, if I entered 10, 12 show my label 10 to 12 which works perfectly, I want to sort it for example if I enter 10 then 6 Labels show labels 6 and 10 that do not work

  Int; (J = 0; j and lt; items; j ++) {if (intelligent persian (labels [ja] .gate text ()) gt; integer.press (utext [1] .gate text ()) break ; For (int a = item; k & gt; j; k -) {labels [k] = labels [k-1]; Label [j] = new jlabel (uttex [1] .gettext ()); Label [J]. Setbound (40 * j, 150, 130, 30); P.add (label [ja]); P.revalidate (); P.repaint (); Item ++; // Label is my array / the number of elements in array array is / / p is panel / uatxt [1] my textfield}}  

Sorry my question is trivial, but I ` Swing in the beginning

Do nothing in graphics, this problem is a logical problem

After reading the fields, sharpen them in an array:

  string text = field .gettext (); ArrayList & LT; Integer & gt; Nums = New Arrestist & lt; Integer & gt; (); Scanner scan = new scanner (text); Whereas (scan.hasNextInt ()) nums.add (scan.nextInt ()); collection. Associate (AM)  

Here you have beautifully sorted in an ArrayList .


hibernate - Can I declare mappings in the persistence.xml? -



hibernate - Can I declare mappings in the persistence.xml? -

i declare in persistence.xml file every string type mapped text type. want declare charset type too.

i woudn't declare mapping every single attribute @column...

there no such 'default' configurations datatypes. need set 1 one.

if want in persistence.xml need add together code like:

your_provider

<!-- create file have mapping, in case file name orm.xml --> <mapping-file>orm.xml</mapping-file> <properties> <!--your properties--> </properties>

create file code code below:

<?xml version="1.0" encoding="utf-8"?> <entity-mappings xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/persistence/orm" xsi:schemalocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0"> <entity class="com.uaihebert.model.test.manufacturer"> <attributes> <basic name="name"> <!--here declare type--> <column /> </basic> </attributes> </entity> </entity-mappings>

hibernate jpa hibernate-mapping

html - Change The Border For a Table in Javascript? -



html - Change The Border For a Table in Javascript? -

what want alter border table (#mytable) j.s function depends on value user enters (ex: user entered 3 => border="3")

i using next code existed in external file called size.js

function chooseborder (size){ switch (size) { case "3": document.getelementbyid("mytable").style.border = "3"; break; case "5": document.getelementbyid("mytable").style.border = "5"; break; case "7": document.getelementbyid("mytable").style.border = "7"; break; case "9": document.getelementbyid("mytable").style.border = "9"; break; default: //make border = 0 document.getelementbyid("mytable").style.border = "0"; break; } }

then in html wrote:

<!doctype html> <html> <head> <title> select border size </title> <script type = "text/javascript" src = "size.js" > </script> <script> number = window.prompt("please select size table border\n 3(3 pixel border)\n 5(5 pixel border)\n 7(7 pixel border)\n 9(9 pixel border)"); </script> </head> <body onload="chooseborder(number)"> <table id="mytable"> <thead> <tr> <th colspan = "4">northern new bailiwick of jersey profit</th> </tr> <tr> <th></th> <th>april</th> <th>may</th> <th>june</th> </tr> </thead> <tbody> <tr> <th>montclair</th> <td>100</td> <td>80</td> <td>90</td> </tr> <tr> <th>clifton</th> <td>79</td> <td>80</td> <td>100</td> </tr> <tr> <th>newark</th> <td>100</td> <td>95</td> <td>91</td> </tr> </tbody> </table> </body> </html>

the problem nil changes on loading page, wrong in code. :)

just minor alter big impact: instead of

document.getelementbyid("mytable").style.border = "3"; utilize

document.getelementbyid("mytable").border= 3;

so function becomes this:

function chooseborder (size){ switch (size) { case "3": document.getelementbyid("mytable").border= "3"; break; case "5": document.getelementbyid("mytable").border = "5"; break; case "7": document.getelementbyid("mytable").border = "7"; break; case "9": document.getelementbyid("mytable").border = "9"; break; default: //make border = 0 document.getelementbyid("mytable").border = "0"; break; } }

and you're go

javascript html css

php - Magento invoice get shipping address -



php - Magento invoice get shipping address -

i want show shipping address of order on invoices. working pretty with:

$shipping = nl2br($order->getshippingaddress()->format('html')); $shipping = explode('<br />',$shipping);

but if have order download product (gift card) a:

fatal error: phone call fellow member function format()...

because order not have shipping address. how can check, whether $order->getshippingaddress() contains info or, if not, not displaying it?

php magento

javascript - Angularfire bindTo for subobjects -



javascript - Angularfire bindTo for subobjects -

i have construction userdatas under $rootscope.myuserdata, like: $rootscope.myuserdata.basicdata, $rootscope.myuserdata.ac, trying optimize queries through firebase.

the problem if want bind them nicely under $rootscope.myuserdata - subobjects, cant this:

$rootscope.myuserdata.basicdata = $firebase( new firebase(resourceurl) ).$asobject(); $rootscope.myuserdata.basicdata.$bindto($rootscope.myuserdata, "basicdata");

for illustration should work fine:

$rootscope.basicdata = $firebase( new firebase( resourceurl ) $rootscope.basicdata.$bindto($rootscope, "basicdata");

if understand correctly, have bind straight rootscope , can't bind e.g. $rootscope.myuserdata.basicdata.

is there way around problem, using construction have $rootscope.myuserdata subobjects or solution alter construction i.e. $rootscope.myuserdata_basicdata?

javascript firebase angularfire

cordova - ERROR : executing command 'ant', make sure you have ant installed and added to your path (Android) -



cordova - ERROR : executing command 'ant', make sure you have ant installed and added to your path (Android) -

i have big problem ant.

when seek run android simulator phpstomr, debug console show me messagge:

/usr/local/bin/phonegap run --emulator android [phonegap] detecting android sdk environment... [phonegap] using local environment [phonegap] adding android platform... /users/stopal/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:126 throw e; ^ error: error : executing command 'ant', create sure have ant installed , added path. @ /users/stopal/.cordova/lib/android/cordova/3.5.1/bin/lib/check_reqs.js:47:27 @ childprocess.exithandler (child_process.js:652:7) @ childprocess.emit (events.js:98:17) @ maybeclose (child_process.js:756:16) @ socket.<anonymous> (child_process.js:969:11) @ socket.emit (events.js:95:17) @ pipe.close (net.js:465:12) { [error: /users/stopal/.cordova/lib/android/cordova/3.5.1/bin/create: command failed exit code 8] code: 8 } [error] /users/stopal/.cordova/lib/android/cordova/3.5.1/bin/create: command failed exit code 8

settings of ~/.bash_profile

export ant_home="/usr/share/ant/1.9.4" export path=$path:$ant_home/bin

some 1 can help me?

android cordova ant

Dirichlet Distribution unit testing -



Dirichlet Distribution unit testing -

does has reliable info utilize write unit tests new implementation of dirichlet distribution?

unit-testing dirichlet

eclipse - How to get data from sqlite to a listview in android without a Datahandler class -



eclipse - How to get data from sqlite to a listview in android without a Datahandler class -

i want info sqlit listview without datahandler class have add together info sqlite without datahandler class

my database name mydb,and table name mytable has coloums name , phone

android eclipse sqlite listview datahandler

angularjs - ui.router 'otherwise' doesn't seems to work -



angularjs - ui.router 'otherwise' doesn't seems to work -

i'm trying ui.router work next setup.

export class router { /* tslint:disable no-unused-variable */ private static $inject: string[] = ["$stateprovider", "$urlrouterprovider", "$locationprovider"]; /* tslint:enable no-unused-variable */ constructor($state: ng.ui.istateprovider, $urlrouter: ng.ui.iurlrouterprovider, $location: ng.ilocationprovider) { $urlrouter.otherwise("/"); $state.state("default", { url: "/", views: { "header": { templateurl: "/views/layout/header.html" }, "sidebar": { templateurl: "/views/layout/side-menu.html" }, "": { templateurl: "/views/workspace/index.html" }, "footer": { }, } }); $location.html5mode(true); } }

here partial file i'm using.

<div id="workspace"> <div id="workspace-header"> <div data-ui-view="header"></div> </div> <div id="workspace-container"> <div> <div data-ui-view="sidebar"></div> </div> <div> <div> <div> <div id="workspace-view"> <div data-ui-view></div> </div> <div id="workspace-footer"> <div data-ui-view="footer"></div> </div> </div> </div> </div> </div> </div>

i'm not sure it's related (or whether it's problem) html above injected using ng-include so.

<div id="dashboard" data-ng-include="'/views/master.html'" data-prevent-touch-scroll></div>

just clear verified router gets called.

i thought 'otherwise' navigate url , transit default state inject partial views doesn't seems work, i'm sure i'm missing cannot figure out.

i solved replacing ng-include ui-view.

<div id="dashboard" data-ui-view data-prevent-touch-scroll></div>

my router looks this.

export class router { /* tslint:disable no-unused-variable */ private static $inject: string[] = ["$stateprovider", "$urlrouterprovider", "$locationprovider"]; /* tslint:enable no-unused-variable */ constructor($state: ng.ui.istateprovider, $urlrouter: ng.ui.iurlrouterprovider, $location: ng.ilocationprovider) { $urlrouter.otherwise("/"); $state.state("default", { url: "/", templateurl: "/views/master.html", onenter: ["$state", "$timeout", ($state: ng.ui.istateservice, $timeout: ng.itimeoutservice) => { $timeout(() => { $state.go("default.master"); }); }] }); $state.state("default.master", { views: { "header": { templateurl: "/views/layout/header.html" }, "sidebar": { templateurl: "/views/layout/side-menu.html" }, "": { templateurl: "/views/workspace/index.html" }, "footer": { }, } }); $location.html5mode(true); } }

i'm not sure whether it's solution or hack works. :)

angularjs typescript angular-ui-router

android - How to make listview more efective? -



android - How to make listview more efective? -

from old google presentation remember should never utilize android:layout_height = "wrap_content" still true? of next layout better? autogenerated implementation

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <listview android:id="@+id/listview1" android:layout_width="match_parent" android:layout_height="wrap_content" > </listview> </linearlayout>

limited availible height

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <listview android:id="@+id/listview1" android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" > </listview> </linearlayout>

surrounded layout

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <linearlayout android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" > <listview android:id="@+id/listview1" android:layout_width="match_parent" android:layout_height="match_parent" > </listview> </linearlayout> </linearlayout>

you should never utilize wrap_content because create listview calculate total height, , involve go throughout list items initialise them , views still true should never ever utilize wrap_content.

in 3rd alternative surround in linearlayout useless because listview can moved upper parent , saving 1 level in view hierarchy such:

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <listview android:id="@+id/listview1" android:layout_width="match_parent" android:layout_height="match_parent"> </listview>

the sec version achieves same version im giving, uses layout_weight difference on using version post here , sec depends on you're trying accomplish, version post create listview height equal parent while sec version distribute remaining height between listview , other views place within linearlayout

android android-listview

javascript - How to get element text without its children -



javascript - How to get element text without its children -

how should element text without text within children?

example:

<div> hi <div> asd </div> </div>

i want 'hi'.

my code it's in jquery , it's working, need have same function in javascript (without jquery):

object.name = $html.find('.title').clone().children().remove().text();

thanks much.

once reference div, jquery i'm assuming has class title

class="snippet-code-js lang-js prettyprint-override">var div = document.getelementsbyclassname('title')[0]; //get reference parent div var name = div.firstchild.nodevalue; alert(name) class="snippet-code-html lang-html prettyprint-override"><div class="title"> hi <div> asd </div> </div>

if want complicate it

class="snippet-code-js lang-js prettyprint-override">var div = document.getelementsbyclassname('title')[0]; //get reference parent div var array = [].map.call(div.childnodes, function(child) { homecoming child.nodetype == 3 && child.nodevalue.trim() ? child.nodevalue.trim() : undefined; }) var name = array.join(); alert(name) class="snippet-code-html lang-html prettyprint-override"><div class="title"> hi <div> asd </div> </div>

javascript jquery html