Posts

Showing posts from August, 2011

c++ - async tcp socket and progress when sending data -

I use http based file uploads in my C ++ code (which runs on Linux / Android). I use async tcp socket to write file data. My point is that my progress bar shows what has been sent in the socket, what exactly is sent on the wire. The problem is clear with slow links, where more than 100% more seconds are sent and send the full message. I do not modify SO_SNDBUF, in my case, by 35KB (query) hokkapet) how can I correctly correct the progress of the current transfer status to reflect progress? Is there a way to query the size of the data present in the buffer? Is there a way to get TCP notification about the transfer progress (as confirmed by remote socket)? You are not able to know the current size of this buffer, because it is in the kernel ground And there is no known / documented ioctl to tell its size even you know it, it will not be portable, thus I do not think it is a good way to solve this problem. You either: To estimate the data rate during the entire transition...

sql - Run a foreach loop on returned results in a stored procedure. -

I have a stored procedure that returns results from Table 1, then I stored another to update that table I use the procedure. I was wondering if I can add it to a stored procedure, the problem is that it will be necessary to update all prices to run a foreach loop on table 2, based on price from table 1 . Where is the idea to start or it is also possible This is something to run for each item Example but you should not need it for updates, you should be able to solve it with cross join, anyway as follows. declare @i int; Set @i = 0; Select the @t table (enter id id, manipulation (maximum) col1, varchar (max) col2, in @t (col1, col2), select col1, from col2 to fir [table] set i = 0; declared @sum int Set @sum = 0; while (i choose

python - TkInter deadlock -

Is there anything wrong with the following code? Running the same code, I get a standoff, where the main thread tries to get lock lock, where the loop does not belong to the pond. In addition, since I can not post it without adding "more details", what would be a good statement in this case? Import import of gold from imported gold from the import of import from Random Import Random Class Test (Tkinter.Tk): def __init __ (self, parent): Tkinter.Tk __int __ (self, parent) self. Promotions (false, false) themselves Grad () self _button = Tkinter.Button (auto, text = 'click me', command = self._foo) self._button.grid (column = 0, line = 0) self._lock = threading.Lock () def __enter __ (self ): Self._loopRunning = True self._loopThread = threading.Thread (target = self._loop) self._loopThread.start () back self def __ext___ (self, x_type, x_wall, traceback): self. _loopRunning = false self. _loopThread.join () Return the wrong def _loop (self): while self._loopRu...

javascript - How to return a value from an anonymous inner function in JS? -

My page allows users to add and remove input boxes to enter search terms. The function that allows them to add them, returns a value (as a way to keep track of a calculated variable amount, I want to limit the field to five.) I have a button here I call the function on click of: & lt; Input type = "button" value = "+" id = "add" onclic = "calculation = pairfilled (calculated);" /> As you can see, the value of the count has been returned to the script. To add the following input field is relevant JS. (There is also an internal function to remove the input field in the app function) starts at // 1, because always there is at least one input box, Var calculation = 1; AddField function (count) {// only if the limit does not reach the limit: if (Count & lt; = 4) {// Increase count by 1, Warning for demo purposes: Calculation ++; Warning (count); // To delete it, create a div to keep the new input and a new button: var divv ...

java - Call parent method from an instance -

I was thinking about this topic: But I'm still not sure what the right The terminology is I am trying to do. I have an example of a test and I want to call a method from "parent" who made an example. Public Sector Main {Public Main} Test Test 1 = New Test (); } Public Zero Show Message (String Message) {System.out.println (Message); }} Public Class Test {Public Test} // I Main How do I call the show message ("Testing is going on")? }} I had the answer in the subject listed above: A class you are expanding and considering which is "parent" The method you are calling on is not stable, the following should do the trick: Supertogleng Visibility (); If this is a static method - it is also simple: main. Show message (); Problem: I am absolutely sure that I can not use the super because I expand a square I'm not and I'm not sure that main.showMessage (); will work because I did not reference the main in the test ...

python - Using render_templete and static file, which one is faster in Flask -

I am developing a web app using flasks in everybody. There will be Kashmir news pages in my web. The information for each page is stored in the database when the user makes a request in the web browser, then the returned page flask can be generated using render_templates (). The problem occurs when all users request the same page, render_templates () will be asked multiple times for the same page => I'm curious to do the same thing by wasting resources, should I use render_templates () or should I generate the K static pages and instead should use the static file? You can use the package. Support cache backends such as dictionary , file system , memcached , redis , and so on Cash backend Example: @ cache.cached (timeout = 50) def index (): Return render_template ('index.html') . @ cache.memoize (timeout = 50) def big_foo (a, b): return + a + b + random.randrange (0, 1000) . @ cache.cached (timeout = 50) def big_foo (): Return Big_bar_calc ()...

osx - Get window id from a click listener with CGEventTap (objective-c) -

I'm trying to hear all the mouse clicks that the user creates. I need to know which window the user has Clicked (possibly by its CG Wandode) I am listening to all the clicks through CGEventTap, but now I do not know how to get a window that was clicked. Do you know some ways to retrieve Window ID from the CGEventRef object? Plus, I know that by using [NSEvent addGlobalMonitorForEventsMatchingMask] by receiving [event window number], I can get Window ID, but I can not use this listener because someone For the reason, after the listener is set up, it blocks all the inputs in my own window, maybe anyone knows where it is coming from? Thank you! Do you windowNumber to CGEvent Are able to reach after being converted to a NSEvent ? CGEvent cgEvent = EVENT_FROM_YOUR_CGEVENT_TAP; NSEECC * NSEVEN = [NSCE Eventual Cause Event: CGIVE]; NSInteger Windonbars = [nsEvent windowNumber];

java - Why do I get a warning when I cast X to X? -

I have a class that implements the interface that declares a method with return type X & lt; Item & gt; And I'm calling another class with a method m () which X I try to return the result directly by casting it: back (x and lieutenant; items & gt;) others. M () Why do I get a warning? What could possibly go wrong? Is there any way to do this which avoids warning? Because it can be a X & lt; SubItem & gt; , which can be found in the X is not. What you are doing is naturally insecure; X If you are sure that this is actually a X , you can use unsafe artists, and you can manually press the warning, because you know more than the compiler. If you are not entirely sure, then your code is broken, and you need to reconsider your type.

c# - IIS 8.0 HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler -

Friends, I am constantly facing this problem, I have tried many things, but what is vein in all Any body can help me with this problem All the stable pages are working but when I open any dynamic page it comes with this error. I am using C # IIS 8.0 If someone can help me then I would be very grateful. HTTP Error 404.17 - Not Found The requested content script appears and will not be served by the static file handler. Most likely reason: the request matches a wildcard Mime map. The request is mapped to the fixed file handler. If there are different statuses, the request will map to a different handler. Whatever you can try: If you want to serve this content as a stable file, add a clear mime map. Requested URL [Localhost: 58273 / Quatocashyl] Physical Path: F: \ ORG \ quote.cshtml Logon Method Anonymous Logon User Anonymous Request Tracing Directory [C: \ User \ Document \ IISExpress \ TraceLogFiles \ ORG2] More information: Sometimes the prerequisite and wildcard MIME m...

java - Deploy partial updates to Jelastic -

Image
I have a 26 MB war file, of which 25 MB are library jar. There is no way of re-telling these jars with the war every time. I saw in the Jellstick Tomcat directory, war file and then war uncompressed material. P> Can you still make incremental updates? You can upload modified jar or other files in your reference folder (such as / root) Then restart the environment to implement changes .

ruby on rails - faraday builder use multixml to parse body -

I want to set up FEDA to use multi_xml and by default to parse the body of my responses. @connection = Faraday.nu (base_urlen) {| Builder | noMethodError: Undefined method `[] 'for zero: From / to NilClass / Users / Blankordus / RVM / Games / RB -2-2.0.0- P353 @Can / Games / Farda_Miliffer 9. 9. / 9 / LB / FARADAM / Model / RApps_Millier RB: 59: User / Blen Cord /. In 'Call in Block' / Users / Blen Cord / 'in response' type in Gems/ruby-2.0.0-p353@can/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb: 31: . RVM / Games / RB -2.0.0-0-p353 @ can / gems / faraday-0.9.0 / lib / faraday / response.rb: 57: in / users / blanecordes / .rvm / gems / ruby-2.0.0 -p353 @ can / from `` Gems / Forday_Millier -0.9.1 / Leib / Fordi_fluffware / Response_llirer_rbi: 30: `Users / Blen Cord / /lib/faraday/rack_builder.rb:139:IN/Users/blanecordes/.rvm/gems in `call 'from RVM / Games / RB -2-2.0.0- P353@can/gems/faraday-0.9.0 In `build_response...

excel - Adding up values in columns with conditions -

Image
Being the first and the first person on this site, I really appreciate your help. WK1WK2WK3WK4WK5 Total 3 hours total, and & lt; & Gt; 4) Susan 5 5 0 5 8 23 15 From my table, I want to add only the first three columns in which there is no zero if the first three has zero, then check on the next column and repeat it again with zero value to complete three columns. Add to Colonel H in the first 3 weeks & lt; & Gt; Some functions in 0 (like I had to do manually). If I can learn any set with VB code set or formula or macros, then thank you very much. I am using Excel 2007. This is the reference to complex formula Ali M ctrl - changes - Enter : = IF (COUNTIF (A2: F2, " 0") = 0,0, SUM (A2 : Index (A2: F2, small (IF (A2: F2 Note that if there are fewer than zero zero values ​​then this works. / div>

php - Coding toolset for Oculus Rift and Facebook combo -

I want to code for oculus rift and my program has full access to Facebook API. This is a leap in my deep but it does not make any difference. I have some programming knowledge and need to learn what I need to learn. I'm thinking of the above combination now: Ogre Plus Oculus API (0.3.1 Preview) Use Facebook PHP SDK (which I Please read it from its C ++) Please advise me on a sensible combination of languages ​​/ libraries. Yes, this cat is more likely to have more than one way to skin, but I think there is a more obvious way for experienced programmers: this is what I am looking for. Additional Notes: I'm not making a 3D game, so I'm excluding unity. I do not know what I am doing (!), But I hope that it will be fun and it will use a crack with FB to make something new. I pre-ordered this question to DK2 It is largely depending on whether you or any particular person has to face this problem, it is easiest to work with it if I was working on it, t...

image - PHP - imagepng not working properly -

Image
अच्छा लोग, सबसे पहले, मेरा कोड है: & lt;? Php ob_start ( ); $ pilot_id = $ _GET ['आईडी']; // - सर्वर चर $ dbServer = 'localhost'; $ DbUser = 'root'; $ dbPassword = '*************'; $ dbName = 'bla_tracker'; // - सर्वर कनेक्शन & gt; & gt; & gt; परिवर्तन न करें & lt; & lt; & lt; $ Sql ​​= mysql_connect ("$ dbServer", "$ dbUser", "$ dbPassword") या मरने (mysql_error ()); $ Select_db = mysql_select_db ("$ dbName", $ sql); $ Query = mysql_query ("select * FROM acars_users WHERE` आईडी` = '"। $ पायलट_आईडी।"' ") या मर (mysql_error ()); $ पंक्ति = mysql_fetch_array ($ क्वेरी); $ नोम = $ पंक्ति ['नोम']; $ पेटेंट = $ पंक्ति ['रैंक']; $ Admin = $ पंक्ति ['व्यवस्थापक']; $ चेकाडोर = $ पंक्ति ['चेकाडोर']; $ query_horas = mysql_query ("SELECT SUM (फ्लाइटटाइम) एएसएआरएसएआरपी से` कुल` के रूप में WHERE iduser = '"। $ पा...

java - Jetty responds with unnecessary redirect -

I use the Jetty-Maven-plugin to run my web application: & Lt; Plugin & gt; & Lt; Group & gt; Org.mortbay.jetty & lt; / Group & gt; & Lt; ArtifactId & gt; Ghat-Maven-plugin & lt; / ArtifactId> & Lt; Version & gt; 8.1.12.v20130726 & lt; / Edition & gt; & Lt; Configuration & gt; & Lt; Webapp & gt; & Lt; ContextPath & gt; / Test & lt; / ContextPath & gt; & Lt; / Webapp & gt; & Lt; / Configuration & gt; & Lt; / Plugin & gt; Next, I use nginx for proxy requests: server {server_name q.ru; 80 Listen; Location / {proxy_ http_version 1.1; Proxy_pass http://127.0.0.1:8080/ test; Proxy_set_header X-real-IP $ remote_adder; Proxy_set_header X-Forward- $ proxy_add_x_forwarded_for; }} Now, I open my browser, and send a request (local / my / etc / hosts). I get infinite redirection. Here is an HTTP dialog dump for NTTN - JT; and JETTY response: received / test hosted HTTP ...

vb.net - how to display flash message to ask select a list from listbox -

Can you guys see this code for me? I would like to try to display a flash message if the user does not select an option from the listboxes public sub BTNHVAClick (By-space as the system. Object, Bye-way system.AventErgues) BTNHVM Handles .Visible = True Code = ListBoxHVM.SelectedValue If the code = "" then the slow message string = "Please select" message box. Show (message) if the code = "B" then select B1 (station) SelectB2 (station) termination if code = "A" then select A1 (station) Select A2 (site )A 3 () end if end You ListBoxHVM.SelectedValue code code = ListBoxHVM.SelectedValue edit 2 if code = "" then

java - how to create gwt gae with app engine modules using google eclipse plugin -

How to prepare a new GWT and GAE project with the module using the Google eclipse plugin in Java? I tried to create a new web application from Eclipse, but it makes me a GWT and GAE project without modules. Thank you. You probably want to create a WTP project using GPT first, because you have to use the module An ER project will need to be created. It is described here: You will create modules, each of which will be a dynamic web project. Your GWT app will be one of those and follow the instructions for the module here: Note that when you right-click your project, two Google related items Will: Google and Google App Engine WTP do not appear to be related to the app engine related to the app engine in the Google menu. Instead, use app engine related commands in the Google App Engine WTP menu.

ios - Show tabular data in table view cell -

Image
How can I add a tabular line like this Android app to an iOS application? This is the second row with integer, they should be centered and equal in width. Com / nkqKp.png "alt =" Enter image details here "> You can use this type of cell in your tableview, simply adding your desired data to these labels while popularizing the table view. Hope this helps .. :)

javascript - Convert 64 bit Steam ID to 32 bit account ID -

How do I change a 64 bit Steam ID into a 32-bit account ID? Steam said taking 32 bits before the number, but how do you do it in the node? Do I need to use BillNl to store 64 bit int? Convert to a 64-bit Steam ID 32-bit account ID, you only 64bit Decrease the ID from 76561197960265728 . Need bigNumber node it is required bignumber = ( "bignumber.js"); Consoleklog (Bignumber ( '7656ll9799l79l363') K zero ( '76561197960265728'))

c++ - I am trying to compile in xcode an open source game called supertux but I keep getting file not found errors -

Image
The source file is divided into different libraries and each has xxx.c and its xxx.h equivalent. Almost all of my classes get me the file. Errors on the first import statement for the file were not found. I removed the "library /" and removed the error. I was thinking that besides going through each of the 1000 classes and for doing the import statement, this is an easy way to do this. I already have "Link Binaries with Libraries "Please help me lost USER_HEADER_SEARCH_PATHS you want You can find this option in the target setting for the #include "..." ... . You can specify the path like this: $ (SRCROOT) / subfolder / subfolder

Attribute programming in C# -

I am new to attribute programming, not sure whether I am asking the right questions or not. I have an abstract base class (abstactbase) and two drywired classes are Derive1 and Derived2. Two methods of My AbstartBase class are Method1 and Method2. Is it possible to use this feature programming, so that when I do this AbstractBase ab = new Derived1 (); I only have access to Method1 and when I use the Derived2 class, then only select Method2 Access is available. Is it possible if yes, then can you give me an example to start? I think that you are connecting two to different types of codes or polymorphism and qualities of your problem What you can do in the situation, you can make an envelope with a method and implement it in your deriving classes differently, so that polymorphism can be used to implement your implementation. For example Public Interface IBase {void Foo (); } Public class Derived1: IBase {public void Foo ()} {/ print derived 1}} public class ...

Python fill list up to certain number -

मेरे पास एक सूची है: [1,2,3,4] मैं इसे 10 आइटम, बाकी के साथ NA जिसके परिणामस्वरूप [1,2] कहते हैं, इसे भरना चाहते हैं I , 3,4, एनए, एनए, एनए, एनए, एनए] मैं इसके माध्यम से पाश कर सकता हूं और अनुलग्नक का उपयोग करके यदि स्टेटमेंट मैं सोच रहा था कि किसी के पास एक रास्ता था जो वास्तव में कम (कोड में वर्णों की कम से कम संख्या) मान लें x आपकी सूची है: x + = ['एनए'] * (10 - लेन (एक्स))

c# - placing link button inside update panel not firing the click event of link button -

& asp: ScriptManager आईडी = "ScriptManager1" runat = "server" & gt; & Lt; / asp: ScriptManager & asp: UpdatePanel ID = "UpdatePanel1" runat = "server" & gt; & LT; ContentTemplate & gt; & Lt; एएसपी: टाइमर रनैट = "सर्वर" आईडी = "टाइमर 2" अंतराल = "60" ऑन्टिक = "टाइमर 1 डाइट" / & gt; & Lt; एएसपी: डेटा लिस्ट आईडी = "डाटा लिस्ट 1" रनैट = "सर्वर" दोहराएं कॉलम = "1" ऑनिटमआर्मैंड = "डेटा लिस्ट 1_आइटम कॉमांड" & gt; & LT; ItemTemplate & gt; & lt; b & gt; टेस्ट नेम: & lt; / b & gt; & lt;% # DataBinder.Eval (कंटेनर.डेटाइटम, "नाम")% & gt; & Lt; br / & gt; & lt; b & gt; टेस्ट फोन: & lt; / b & gt; & lt;% # DataBinder.Eval (कंटेनर.डेटाइटम, "फोन")% & gt; & Lt; br / & gt; & Lt; asp: LinkButton आईडी = "btnView" runat = "server...

validation - In rails, how can I have a unique constraint on a has many through association -

मेरे पास निम्न है: class A & lt; सक्रिय ... has_many: bs has_many: सीएस, के माध्यम से:: बीएस स्वीकार करता है_सेंटेड_एटी के लिए योगदानः bs स्वीकृत करता है_एस्टेड_एटी के लिए योगदानः cs end clas B & lt; सक्रिय ... संबंधित_तो: एक संबंधित_तो: b accepts_nested_attributes_for: cs end class C & lt; सक्रिय ... has_many: bs has_many: as, through:: bs end मैं एक विशिष्टता बाधा जोड़ना चाहता हूं ताकि A.cs के सेट कर सकें कभी भी दोहराया नहीं जा सकता इसका मतलब यह है कि कोई दो नहीं है जैसा कि उनसे संबंधित सीएस का एक ही सेट हो सकता है। यदि यह ए मौजूद है: एफ़ीरस। सिंबल (: कुंजी) = & gt; ['सी 1', 'सी 2'] तब कोई अन्य ए नहीं हो सकता है [ए 'सी 1', 'सी 2'] जिसे पहले ए हटा दिया गया है या अपडेट किया गया है। > मैं 2 तरीकों के बारे में सोच सकता हूं, लेकिन एक रेल मार्ग है: 1) एक 'सीएस' कॉलम को जोड़कर A तालिका का मानकीकृत करें जिसमें सभी की एक स्ट्रिंग है प्रत्येक A वस्तु से संबंधित सीएस , फिर उस नए 'सीएस' कॉलम पर बाधा डाल ...

php - What is the difference between @$_POST vs $_POST....? -

इस सवाल का पहले से ही एक उत्तर है: 11 जवाब मैं अलग-अलग तरीकों से देख रहा था किसी ब्राउज़र के रीफ़्रेश के बाद किसी उपयोगकर्ता के इनपुट को सहेजने के लिए और मैं इस पर फिर से आया हूं: value = "& lt;? Php echo @ $ _ POST ['blah'];? & Gt;" & gt; और मैंने यह भी निम्न की तरह देखा है: मूल्य = "& lt;? php echo $ _POST ['blah'];? & gt; "& gt; ये दोनों एक ही काम करते हैं $ _POST सरणी के लिए तैयार @ चिह्न का क्या महत्व है? क्या एक तरीका दूसरे के ऊपर पसंद किया जाता है? @ PHP है असल में, एक अभिव्यक्ति (जैसे कि एक सरणी प्रवेश या फ़ंक्शन कॉल) से पहले इसे डालने से कोई भी त्रुटियां रोक दी जाएंगी जो आम तौर पर उत्पन्न हो जाएंगी। कार्यात्मक रूप से, कोई अंतर नहीं है, आपकी सेटिंग्स के आधार पर, चेतावनियां / नोटिस जेनरेट किए जाएंगे और लॉग या प्रदर्शित किए जाएंगे। इस मामले में, यदि 'blah' $ _POST सरणी में परिभाषित नहीं है, तो पहला फॉर्म (@ के साथ) एक नोटिस नहीं बनाएगा, जबकि दूसरा फॉर्म। जो भी पसंद है, मेरे अन...

asp classic - Better Way to Write ASP If Statement -

I have my statements in ASP and one of them looks like this: If I Mod 120 = 0 or I Mod 124 = 0 or I Mod 128 = 0 or I Mod 132 = 0 or I Mod 136 = 0 or I Mod 140 = 0 or I Mod 144 = 0 or I Mod 148 = 0 or I Mod 152 = 0 or I Mod 156 = 0 or Mod 160 = 0 or I Mod 164 = 0 or I Mod 168 = 0 or I Mod 172 = 0 or I Mod 176 = 0 or Mod 180 = 0 then Actually it uses the mod Four increasing from 120 to 180. There are no exceptions in this, I'm somewhat new to this and can not understand a more streamlined way to write this code. If I have such statements and figures, then it will make the code more readable and cleaner, if I can find an easy way to write it. Thank you for your help! Block the loop through for a statement

tfs - How to stop Visual Studio from asking if I want to save a solution file every time I make adhoc changes? -

Image
Currently I am working on a project that has many changes in many files in source control (TFS) I I open the file through Visual Studio through the source control explorer, I can make my own changes and check it, but every time I see it in Visual Studio, I ask whether I save the solution file I want it to be created automatically, here are the options "yes", where I have to create a solution file that I do not want, or "no" and this is my phone number. Does not verify Il. The only way around it is to stop the solution (I never wanted to make that file before checking it inside) This behavior is a real nuisance and slows me down. I just want to make my change and want to check my file. Is this possible? In the menu from Visual Studio Tools, select "Options", then "Projects and Solutions" Always uncheck the option "Show solution". When you close your project , Even then it will create a solution file for you but will not give y...

How to compare the elements in 2D array in php -

Hello I'm getting an array like this ... array (array ( 1, 3), array (4, 6, 8), array (2, 3, 5, 1)) Now I compare the first element with all the elements in the second row I want to compare 4,6 and 8 with 1. Then with third row elements, with 1, 2,3,5 and 1. Similarly I want to compare 1 is completely present twice given array .... then variable count1 = 2 .... Similarly 3 exists 2 times so many count2 = 2. 8 is present only once, so count8 = 1 .... like this ... Please help me solve it. thank you in advanced. If you just after a frequency table, you can level it and get a match You can use: print_r (array_count_values ​​(call_user_func_array ('array_merge', $ array)); Output: array ([1] => 2 [3] => 2 [4] = & gt; 1 [ 6] = & gt; 1 [8] => 1 [2] => 1 [5] = & gt; 1)

c# - Grouping strings based on two keys -

I have a list of strings with each string, which is different from # . > I want to do group strings such as 1 # 2 and 2 # 1 will be in the same group .. For example, take this list as an example {"1 # 2", "1 # 6", "1 # 2", "2 # 1"} I want to add this list to the group like this key = 1 # 2 or 2 # 1 value = {"1 # 2", "1 # 2", "2 # 1"} key = 1 # 6 or 6 # 1 value = {"1 # 6"} So I base two different keys I want to group the string on I tried list.GroupBy (x => x); But in this three key, 1 # 2 , 2 # 1 , 1 # 6 The group performs 1 # 2 or 2 # 1 , 1 # 6 You can try to do something like this: void Main () {var list = new string [] {" 1 # 2 ", "1 # 2", "2 # 1"}; Var result = list.GroupBy (x => x.Split ('#'). Order b (y = & gt; y). Overgraduate (a, b) => a + "#" + b )); // should output only one key - foreach...

ios - Reading from two files one after other using avassetreader -

What do I need to merge two movie files? I want to read from the files and write the sample in a different file. How can I read a file and then continue to read the second file. So that I can continuously get sample buffers which can be combined with AVAssetwritter. You need to create an AVMutableComposition, add an AVMutableCompositionTrack and then add each property to AVMutableCompositionTrack. Here is another question that shows the process adequately. Once you have AVMutableComposition, you have to associate it with your AVAssetReader. After that, what you are looking for is what it is. However, if you just want to have a basic stitch (with audio), then note that using AVAssetExport avoids the need to bother with the asset reader and the assetverter and will export once In AVMutableComposition Note that if you also want audio, then this is another track on your AVMutableComposition.

java - command line parsing using apache commons cli -

Tryng to use m apache commons cli, my use case is the variable number of arguments with some options. Say -p str1 str2; this could be -p str1 str2 str3. Strn another -m str1 -h with cmdline.getOptionValues ​​("p"); This only brings the final string. How can I get all the values ​​of a particular option? Edit: if (Cmdline.hasOption ("p")) {string [] argsList = cmdline.getOptionValues ​​(p); String string = arrays.toString (argsList); ArgsList = strLine.split (","); } Am I doing this right? Should I get accurate data in the string that I want or unknowingly add white spaces to someone else? Use isres () with a value separator set to a comma , Then the option becomes -p str1, str2, str3, ..., strn CLI

python - remove time from django DateTime in Django -

So I will have to remove the date time, so get me only the date, year and month. "2014-04-17T00: 00: 00" I looked at different occasions but it does not work class list (model model): manufacturer = model.carfield (max_long = 255) model = model.carfield (max_long = 255) description = model. Textfield (max_long = 255) count = model.IntergerField (max_long = 255, default = 1) location = Models.ForeignKey ('location', empty = true, empty = true) cover = model .Filefield (upload_to = 'static / images / ', Default =' static / images / no-image.png ') Created = models.DateTimeField (auto_now_add = true) Barcode = Model. Chargefield (max_length = 255) assigned = model. Forngi (user, blank = true, empty = true) check = model Boolean field (default = false) modified = model DataTamField (default = datetime .datetime.now) tags = TaggableManager (= none, via empty = True) def __unicode __ (self): returns '% s'% date (self.modified, "n / ...

vbscript - Read CSV File By Line in ASP -

I am trying to read a CSV file with VBScript and it is causing big problems because it does not recognize a line break. The way I have it now: set objFSO = CreateObject ( "Scripting.FileSystemObject") to objFile = objFSO.OpenTextFile (server.mappath ( "my_csv_file.csv"), ForReading) until reading objFile.AtEndOfStream strline = objFile.ReadLine arrFields = Split (strLine, ",") LOOP_STUFF_HERE loop There are several lines in the CSV file but the problem is that the CSV file Is in the form of a line and the last item of each line is being added to the first item of the next line because there is no comma after the previous line Land (it has been made by a customer of mine in Excel and then sent me). My solution is that I have to open it in a text editor, manually add a comma at the end of the lines and then remove the line break. This will not work for a long time because we are installing an automated system. In fact, I should be able to Split lin...

non ascii characters - Accents in HTML5 datalist -

In one form, I have a text input with a dentist in Dalit, I have emphasized those words which Text will not appear in the input. For example: If I type "a", then suggestions in words with "¤¤" or "" will not appear ... The best sign will be insensitive Does any problem already appear? Thanks A dirty way you can do that, something like that By: var noAccent = str.normalize ("NFD"). Replace (/ [\ u0300- \ u036f] / g, "");

c# - Linq query how to select all columns -

I have a linq query that gives me the desired output: var data = (dtskip.AsEnumerable (c) ), Field C. ("state"), sefield & lt; string & gt; ("id"), seafield & lt; string & gt; ("SEARCHKEY"), c. Field & lt; string & gt; ("RATING"), c.Field & lt; string & gt; delivery "}}); I c.field & lt Instead of giving names such as; string & gt; ("postcode"), how can I select all the columns . Only outputable output from my output: ["Darwin", "0800", "NT", "2", "Darwinant", "A", " Delivery Area ", [" Elaa "," 810 "," NT "," 5 "," Elvint "," A "," Delivery Area "], [" BRINKIN "," 0810 "," Any other way I can get the output from the dataset using data Linq query. is a member of Detroit that gives the array as an array ...

SSO implementation using Shibboleth with Google App Engine java -

I am developing an application on Java in Google App Engine in this application. SSO will work as my Google App Engine Application Service Provider and Identity Provider. It will be a separate server, I just have to write on the side of the SSO. I'm new to SAML and have done a lot more on SAML and have come to the basic flow of user authentication in SSO. I found the openssml library that can be used to handle SAML messages between IDP and SP. I found Shibolith which is the implementation of the opensaml library, I am very confused about the decision to choose OpenML or Shibleth. Can someone suggest me on choosing opensaml or Shibboleth and if someone sp Implementation Any tutorials found in the Google app engine can also be shared. You can embed (applications created on OpenSAM) in your application, this will enable you to act as SAML 2.0 Service Provider. / P> You can see a performance of such an approach, in which the Spring SAML sample app is shown with the SSO...

java - Getting Key of Generic List -

यह प्रश्न एक सटीक डुप्लिकेट है: का कहना है कि मेरे पास एक प्रकार की सूची है, जैसे a.getKey () (यह एक मौजूद नहीं है ..) मैं सूची प्रकार संग्रह की कुंजी प्राप्त करने की कोशिश कर रहा हूँ। क्या इसमें कोई भी विधि निर्मित है? यहां Java.util.List एपीआई है, जो मुफ्त ऑनलाइन प्रदान की जाती है । जब आप अंतर्निहित तरीकों के बारे में प्रश्न पूछते हैं, तो आपको एपीआई पढ़ना चाहिए। मैं इसे लेता हूं आप & lt; E & gt; के बाद कर सकते हैं, जिस वर्ग का ऑब्जेक्ट में संग्रहीत है आपकी सूची आप सही हैं, क्योंकि इस जानकारी को पाने के लिए कोई मूल पद्धति नहीं है, इसलिए आपको अपना खुद का तरीका बनाना है। मेरी सोच की पंक्ति: जांचें कि सूची खाली नहीं है पहले तत्व प्राप्त करें और इसे वस्तु ऑब्जेक्ट क्लास में अपने ऑब्जेक्ट क्लास को वापस करने के लिए getClass () विधि का उपयोग करें आप बाकी को समझते हैं कुछ भी असंभव नहीं है, आपको कभी-कभार रचनात्मक होना पड़ता है। - ऑब्जेक्ट एपीआई

Unable to change button text to icon immediate after click button in java swing -

I have written the following code. I have shown the full source but not the psudo code. The class UI has made JFrame {// with ButtonClick () a button) // // button before the // set icon, open the file, open the file and press the file button Get the .set text (""); Image Icon Progress Bar = New Imagine (Dataset Explorer UI Clash. GETRSource ("/ progreassbar.gif")); buttonExport.setIcon (progress); // Some databases were operated // Then removed the button from button button. Set icon (empty); button.setText ("click on"); }} When I click on the button, this file opens an open dialog and the button is set to clear the text but it does not set the icon on the button. When all the database operations are performed, the icon is displayed on the button that is set after the mark. Why is this behavior? How to set the icon on the button and perform some database operations and then delete it? Thank you. The GUI system can only do the same thing at ...

Unable to access dynamically changed JavaScript with dynamic HTML -

Image
& lt; शैली & gt; * {मार्जिन: 0; पैडिंग: 0; } पाठयरा {resize: none; पैडिंग: 10 पीएक्स; ऊंचाई: 100 पिक्सेल; चौड़ाई: 50%; } #output {ऊंचाई: 100px; चौड़ाई: 50%; रंग: #fff; पृष्ठभूमि रंग: # 222; } & Lt; / style & gt; & Lt; शैली आईडी = "कस्टमस्टाइल" & gt; & Lt; / शैली & gt; & Lt; स्क्रिप्ट प्रकार = "टेक्स्ट / जावास्क्रिप्ट" & gt; फ़ंक्शन टॉगलहैम () {document.getElementById ('inputboxcss')। style.display = "none"; Document.getElementById ('inputboxjs')। Style.display = "none"; Document.getElementById ('inputboxhtml')। Style.display = ""; } समारोह togglecss () {document.getElementById ('inputboxhtml')। style.display = "none"; Document.getElementById ('inputboxjs')। Style.display = "none"; Document.getElementById ('inputboxcss')। Style.display = ""; } समारोह togglejs () {document.getElementById ('inputboxcss')। style...

asp.net mvc 5 - bug is creating multiple users with google auth -

I have an asp.net mvc 5 site currently hosted on Windows Azure (usually when I have started auction or deployed) then the certification looks out of the bug. I try to log in with my google account and I get a strange redirect loop, where I sign in and let me get it back to the login page directly. This is normally done by Windows Azure But it is decided by restarting Every now and then however, it will redirect from Google and ask me to enter my username to complete the registration process. This is on my Google account which is already registered, it is entering the same Google Account twice or sometimes three times. It has happened to me and my users and I only listen to it when someone contacts me and tells me that they have lost all their stuff on their site, their profile. Has anyone experienced this like this? I am using standard login / audio controller with an MVC 5 project. Edit :: My URL is www.dev-score.com, but it also responds simply dev-score.com It may be...

java - Hash maps and hashcode that changes, how to tell set that object has changed? -

hashpaps and hash code questions A POO is more than written, hashode and helping with fraction Comparator is comparable (not shown here) package coll.hset; Public class Dat {private string name; Private string data; Private int aa; // Some commercial reasons have not been used in the hashcode and public int hashCode () {int h = 0; If (name! = Null) {h + = name.hashCode (); } If (dat! = Null) {h + = dat.hashCode (); } Returns H; } Public Boolean equivalent (object o) {if (o installation of DAT) {Dat oo = (Dat) o; If (this.name == tap & oo.name! = Null) {return false; } And if (! Name.equals (oo.name)) {return false; } If (this.dat == faucet & oo.dat! = Null) {return false; } And if (! Dat.equals (oo.dat)) {return false; } Back true; } return false; } Public string getName () {return name; } Public Zero Setname (string name) {this.name = name; } Public string getDat () {return dat; } Public Zero Setdate (string data) {this.dat = dat; } Public int getAa () {return AA; } P...

json - groovy: how to catch exceptions on AsyncHttpBuilder -

I am trying to create an async call in a domain. The following code works fine if I specify a valid address with the json response, but when the address is not valid, I want to capture any possible exceptions. How can I catch exceptions back? / p> A quote from StackTrace here: Message: Invalid JSON string ... http.AsyncHTTPBuilder - Exception throw From the given response reporter: groovyx.net.http.HTTPBuilder$RequestConfigDelegate@420db81e Code here: def http = new asyncHTTPBuilder (poolSize: 1, contentType: ContentType.JSON) Def futureResult futureResult = http.request ("http://www.notexistingdomainxyzwq.com/", Method.GET, ContentType.JSON) {response.success = {resp, json -> Log.info ("success")} response.failure = {resp, json -> Log.info ("ERROR")}} log.info ("call start"); try {while (! futureResult.done) {log.info ('waiting ...') log.info ("done: $ {futureResult.done}") Thread.Sleep (1000)}} hol...

performance - NVidia CUDA Thrust device vector allocation is too slow -

Does anyone know why the vector allocation on the device takes a lot more to the first part compiled in debug mode? In my special case (NVIDIA Quadro 3000M, Kuda Toolkit 6.0, Windows 7, MSVC2, 2010) debug compiled version takes the first run more than 40 seconds, the next (no recombination) takes 10 times less ( Vector allocation on device for release version 1 second). #include & lt; Emphasis / host_vector.h & gt; #include & lt; Thrust / device_vector.h & gt; #include & lt; Thrust / generate.h> # Include & lt; Emphasis / order & Gt; # Include & lt; Emphasis / Copy H & gt; # Include & lt; Cstdlib & gt; # Include & lt; Ctime & gt; Int main (zero) {clock_t t; T = clock (); Emphasis: host_vector & lt; Int & gt; H_vec (100); Clock_t dt = clock () - t; Printf ("Allocation on host -% f seconds. \ N", (float) DT / CLOCKS_PER_SEC); T = clock (); Emphasis: generated (h_vec.begin (), h_vec.end (), rand); DT = clock (...

php - FOSUserBundle (Symfony2). I have some questions -

1) How can I add new fields and registration actions to the table (show new fields on the reged page)? For example: I want to add new fields last_name, age 2) I added a new listener for REGISTRATION_COMPLETED /src/Acme/UserBundle/EventListener/RegistrationCompletedListener.php: & lt ;? Php namespace Acme \ UserBundle \ EventListener; Use FOS \ UserBundle \ FOSUserEvents; Use FOS \ UserBundle \ Event \ FormEvent; Use Symfony \ Component \ EventDispatcher \ EventSubscriberInterface; Use Symfony \ Component \ HttpFoundation \ RedirectResponse; Use Symfony \ Component \ Routing \ Generator \ UrlGeneratorInterface; / ** * Listener * / Class Registration Completion Event Subscriber Interface {Private $ router; Public function __ composition (UrlGeneratorInterface $ Router) {$ this- & gt; Router = $ router; } / ** * {@ Inherit Doc} * / Public Static Function getSubscribedEvents () {Return Array (FOSUserEvents :: REGISTRATION_COMPLETED = & gt; 'onRegistrationComple...

database - SQL Command error ORA-00933 when deal with three tables -

Text after " CRS_T_RES_VOUCHER where IS_OFFLINE_BOOKING is true (all vouchers received from the system) Date - CRS_T_RES_REGISTRATION. UPDATED_DATE ) & gt; Offline canceled threshold Offline canceled threshold can be taken from the CRS_T_HTL_PARAMETER table. PARAM_KEY - IBE_OFFLINE_CANCELLATION_THRESHOLD CRS_ T_RES_VOUCHER v, CRS_T_RES_REGISTRATION regi, CRS_T_HTL_PARAMETER Para WHERE v.is_offline_booking = '1' and choose from TRUNC (SYSDATE) v.VOUCHER_NUMBER - TRUNC (v.updated_date) & gt; Para.param_value Where do I encounter Ora-00933: SQL command does not end correctly Post -text "itemprop =" text "> I found it needed to deal with nested query CRS_T_RES_VOUCHER V, CRS_T_RES_REGISTRATION regi, selection from paras to vc. Vouc, where CRS_T_HTL_PARAMETER v.is_offline_booking = '1' and TRUNC (SYSDATE) - TRUNC (v.updated_date) & gt; (Select TRUNC (para.param_value) from the CRS_T_HTL_PARAMETER paragraph where pa...

javascript - how to insert and if defined for a variable in webstorm -

Looks like I have a code var val = event.deltaX; How do I put a code which will replace if (event.deltaX) in the above {x = event.deltaX; } You can try to use live templates for this - around Look at the side.

How to override product_url in Spree 2.x / Rails 4 to make more SEO friendly? -

मैं अपने उत्पाद यूआरएल को देखना चाहूंगा: / product-name-here / P के बजाय: / उत्पाद / उत्पाद-नाम-यहां मैं इसे कैसे प्राप्त कर सकता हूं ? बहुत सारे अनुसंधान के बाद मैंने इसे समझ लिया इस प्रक्रिया में दो चरण हैं पहला तरीका है जो नए उत्पाद मार्ग से मेल खाता है। तो अपने मार्गों में जायें। आरबी और इस खंड में: माउंट स्परी :: कोर :: इंजन, एटी = & gt; '/' # स्प्री विशिष्ट मार्ग यहां समाप्त हो गया है इस लाइन को जोड़ें: get ': id / p' = & gt; 'Spree / products # show' तो अब यह इस तरह दिखता है: माउंट स्परी :: कोर :: इंजिन,: at = & gt; '/' # स्प्रीड विशिष्ट मार्ग यहाँ प्राप्त करें ': id / p' = & gt; 'स्प्री / उत्पादों # शो' एंड इस बिंदु पर आप नए यूआरएल संरचना के साथ उत्पाद पृष्ठ पर जाने में सक्षम होना चाहिए: / product-name-here / p समस्या यह है कि उत्पाद पृष्ठों पर स्वचालित रूप से उत्पन्न सभी लिंक्स अभी भी पुरानी यूआरएल संरचना का उपयोग करेंगे, इसलिए हमें इसे ठीक करना चाहिए। ऐसा करने के लिए ह...

javascript - Make Background Black for screen other than popup div -

Image
I have the following div that I'm showing as a popup: lt; Div id = "divoperationmessage" style = "background-color: white; border: 2px solid black; display: block; width: 350px; z-index: 1001; top: 60px; left: 240px; condition: fixed; padding-left : 10px; margin: auto; "& gt; Whatever the content inside ---------------------------- - & lt; / Div & gt; When shown, I can easily see the second part of the screen in the main background. View it as below: (The entry update has successfully popped up the division) I want to black it .. How do I Can i black I tried to set Opacity from 0.75 ... but with the wrong intention ... I did not solve my purpose .. What can I do for it? ??? Please help me Ok here goes! & lt; div style = "height: 100%; width: 100%; position: full; top: 0; left: 0; background color: # 000000; display: none;" & gt; & Lt; Div id = "divoperationmessage" style = "bac...

Toggle the PHP session variable everytime the page is reloaded -

I have a different requirement that the page is reloaded / refreshed, toggling variable values ​​of php saver every time Want to say, I have a variable $ _ session ['id'] = 1; When the page is reloaded, the value should be changed to 0. But when this should not happen then the second page is opened. My session variable is in page 1. When page 1 is reloaded, then the session variables should be changed. But when we go back to page 2 and come back to page 1, then it should be the same as before. thank you in advanced. $ _SESSION ['var'] = empty ($ _ session [var ']) ? 1: 0;

windows 8 - Error during rate app -

In my app I get an error message when users are credited after rating. Get the error c101a006. Why this happens, there is an open shop, but not able to submit the review As far as I have not received any error, at least one on Windows 8 machines Not running more accounts. How do I work on ratings on machines running an account? This is ZEST_E_INTERNAL_SERVER_ERROR, it indicates that an error tries to process the server from you While having a heart attack, the rating page is displayed by the Store app on your machine. I had no problem presenting the rating for your app. So it does not have to do anything with your app, there are web server errors, it can take a few days to resolve. At least my test is clear that the server can no longer be a problem. If you still have a problem, log in to something wrong with your Microsoft account and double-check that your birthday and home country have been entered.

c# - Displaying FQN in Expression.Call -

I'm trying to represent the string of Static method calls that I've created using Expression Tree. However, FQN is not a literal representation in text representation. TestMethod () output code instead of AnotherClass.TestMethod () Edit: This is just a simple example Eventually the output can be something like this: - Other class. Test method method & gt; Guid & gt; ("BLOB_DATA", New MyClass ()) Therefore, I'm not just trying to get the FQN of a method, the original expression object may not even call a method I thought Was that the expression is too complicated, no toasting will return the C # code which it can represent The goal is to convert the original expression into the C # code snippet, which I used to remember in memory I can use and compile. using the system; Using System.Linq.Expressions; Using the system. Namespace Expression Test {Private Static Zero Main (string [] Args) {// Version 1 Dyslexation Call = Expression Call (...

angularjs - Protractor locator can't find html element in phantomjs only -

I have some tests that are working fine in Chrome, but if I switch to phantomjs, : Unable to find element with CSS selector. The selectors have a ' my test just: this should be (navigate when clicking' edit ', function () {var editLink = Element (by.css) (element ('selected-recipients one')). Elements (by CSS ('edit preview')); editLink click (); Hopefully (browser.getCurrentUrl ()) .contain ('# / The recipient');}); This works fine on chrome. Problem is patchwork. I think this problem may have to be done with window size, but it suggests not solving the problem for me. A post found: I also tried to use by.id by CSS and I have the same problem All other tests in this file are fine and some use. CSS, then it does not look like a problem with the gatekeepers who understand this locator. It seems that the element is not on the page at all. Any thoughts? Thanks When phantomjs are acting in a strange way, I dump a screen shot. M...

c++ - C++11 Threads: Error passing a vector to a thread function -

I am working on a multi-thread middle function as part of a larger project. I have a lot of C ++ experience. The average work below should take a vector of 3-dimensional difference vectors, and return a 3-dimensional vector of inss where each entry input vector has the average value of all the entries in that index. So if the input is & lt; & Lt; 3,2,1>, & lt; 1,2,3>, & lt; 2,2,2 & gt; >, & Lt; 2,2,2 & gt; Return in This code will be used in real-time video implementation for the use of an average blur, so the desire to increase it. #include & lt; Thread & gt; # Include & lt; Iostream & gt; # Include & lt; Mutex & gt; #include & lt; Vector & gt; # Include & lt; Algorithm & gt; #include "median.h" // mutex to protect brugPixel (possibly not necessary) std :: mutex mtx; Std :: vector & lt; Integer & gt; Middle (const std :: vector & lt; std: vector & lt; int & gt; & amp; ...

javascript - Hide the url of pdf document opened in browser? -

/ P> अगर बस मेरी आवश्यकता कह रही है: " उपयोगकर्ता को पीडीएफ लिंक ढूंढने का कोई रास्ता नहीं होना चाहिए। वह केवल पीडीएफ की सामग्री देख सकता है " नहीं। उपयोगकर्ता को पीडीएफ देखने के लिए, पीडीएफ डेटा को भेजा जाना चाहिए उपयोगकर्ता के ब्राउज़र। ब्राउज़र में भेजे जाने वाले पीडीएफ डेटा के लिए, आपको उस ब्राउज़र को बताना होगा जहां पीडीएफ है। जो भी आप ब्राउज़र को बताते हैं, आप उपयोगकर्ता को बताते हैं (क्योंकि उपयोगकर्ता कई ब्राउज़रों के लिए स्रोत कोड तक पहुंच के बिंदु पर ब्राउज़र को नियंत्रित करता है, और आप नहीं करते हैं)। आप घूम सकते हैं अस्थायी यूआरआई, कुकी आधारित प्रमाणीकरण, और इतने पर। यह संभवतः आपको बहुत अच्छा नहीं करेगा हालांकि यद्यपि उपयोगकर्ता हमेशा पीडीएफ को सहेज सकता है और इसे कहीं और फिर से प्रकाशित कर सकता है।

php - Split strings into Dictionary words -

I am looking to see if a string is the most efficient algorithm for PHP only or not-was created from words to check Am Example: thissentencewasmadefromenglishwords thisonecontainsyxxxyxsomegarbagexaatoo net thisisalsobadxyyyaazzz Output: thissentencewasmadefromenglishwords net a.txt are dictionary words b.txt wire: one character only I recommend a recursive approach like this: & lt; Php $ wordsToCheck = array ('otherword', 'word1andother', 'word1k', 'word1word2', 'word1word3', 'word1word2word3'); $ WordList = array ('word1', 'word2', 'word3'); $ Result = array (); Function OnlyListed Words ($ word, $ word list) {if_array ($ word, $ wordList)} {return true; } And {$ length = Stellen ($ word); $ WordTemp = $ word; $ Part = ''; For ($ i = 0; $ i & lt; $ length; $ i ++) {$ part = $ WordTemp [$ i]; If (in_array ($ part, $ wordList)) {if ($ i == $ length - 1) {true back...

javascript - why the fiddle code is not run as same on dropbox? -

I download a code from the dropbox. When I run my code, it works. I am running "simple.html" here the link is and check all my code on Bella. It will not work as a browser .. Why? $ (document) .ready (function () {$ ("# browser"). Tree view ({toggle: function (e) {alert ($ (this). Find ('ul ') .closest.id); //alert('===='this.attr('id')); console.log ("% s was toggled.", $ (this) .find (" & gt; Click (function () {branches of var = $ (" "+" Here's your problem: jQuery 1.8.3, 1.7.2, and 1.6.4 will work. Use the old version of jQuery and it will work perfectly fine. For JSFiddle, there is no image folder, because you are not looking at images also because of your CSS reference "Picture / Image .png" JSFiddle. Change them to "image.png" and it should work.