Posts

Showing posts from April, 2015

dependency injection - Java Weld CDI alternative Factory -

A factory to me in my production code, the factory should be fun in my test code. I have to apply to both the interface, which factories: public interface FtpTransferFactory {FtpTransfer createFtpTransfer (string host, string machine); } Production code: default public class implements FtpTransferFactoryImpl FtpTransferFactory {public FtpTransferFactoryImpl () {} @ Override public FtpTransfer createFtpTransfer (final String host, final String Machine) {return new FTP transfers ( ); // some real FTP transfer object}} Test code: @Alternative implements public square FtpTransferFactoryTestImpl FtpTransferFactory {@Override public FtpTransfer createFtpTransfer (String host , String machine) {return ...; // Some real FTP transfer objects, with different settings (test env)}} Beans located on soya / test / resources. In XML: & lt; Options & gt; & Lt; Classes & gt; Engine.FtpTransferFactoryTestImpl & lt; / Square & gt; & Lt; / Options & gt...

rspec - A struggle about TDD(BDD) in rails -

I am new to Ruby on Rail Development. I have read a book called Ruby on Rail Tutorial written by Michael Hart, who writes a test before implementing the function using RSPC. Although I do not think this is a good idea, it's a good idea. Since I already know what the content should contain in the page, I should write the code like these unnecessary stuff, 'It should be ...' I plan to write a blog to practice my rail skills But I suspect that I should write TDD or BDD and it will bring me some benefit value Take that you have a big app and many developers can apply this application Connections are concurrently contribute. Apart from this, you have hundreds of modules and they have validation and calculation and all of them are very many. Will you test it manually and will the test be completely enough? Here the place where TDD is really important with automation, I have become like you once and still (my part). But from time to time, I realize that I can not fully ...

popup - iOS 8 : Keyboard Extension. Issue with adding pop up of keys -

Image
I am creating my keyboard extension app and added a key pop animation to the button on the user's tap on it. It works fine for the inside image but the top line image is hidden for the pop up area because this subview clips. I tried with the ClothBond property and set it as incorrect. But still no one is working, does anyone have any idea how to fix this? Adding a subview on supervision also does not work Image A is showing correct pop up because it has a frame inside the keyboard. The image is wrong as the pop-up clip inside the B frame. Anything outside the view is allowed to be displayed; It will be cleared automatically.

python - Difference between flask.ext.openid and flask_openid? -

इस सवाल का पहले से ही एक उत्तर है: 3 जवाब मैं एक वेबसाइट बना रहा हूँ (भयानक!) फ्रेमवर्क का उपयोग करके, और इसके लिए मैं कभी-कभी एक्सटेंशन का उपयोग करता हूं ट्यूटोरियल में यह हमेशा कहता है कि आपको इसे कुछ (ओपनआईड के मामले में) का उपयोग करके आयात करना होगा: आयात करें ओपनआईडी लेकिन मैं हमेशा निम्न का उपयोग करता हूँ: flask_openid आयात से ओपनआईडी क्या दोनों के बीच कोई अंतर है? और यदि हां; जो एक बेहतर है और क्यों? वे समान हैं, लेकिन। यदि आप फ्लास्क प्रलेखन को देखते हैं: फ्लास्क flask.ext नामक एक रीडायरेक्ट पैकेज को सेट करता है जहां उपयोगकर्ताओं को एक्सटेंशन को आयात करना चाहिए। यदि आपके पास उदाहरण के लिए flask_something नामक एक पैकेज है, तो इसे flask.ext.something के रूप में आयात करेगा यह पुराने नामस्थान पैकेज से संक्रमण के लिए किया जाता है। और यहां: फ्लास्क एक्सटेंशन को उपयोगकर्ताओं को flask_foo या flaskext_foo के बजाय flask.ext.foo से आयात करने का आग्रह करना चाहिए इसलिए नए पैकेज नाम शैली का उपयोग करना बेहतर है: तो आपको इसका उपयोग करन...

python - How to make a while loop exit when user enters a certain string? -

I am conducting a survey that asks the user about age, gender, etc., using a time-lapse Tax. If the user enters some stars like "cya" or "bye", then what is the procedure to exclude the program from the loop? I know that I can make a one-statement after every input, but is there a quick / easy way to do this? Example of what I want to achieve: while (the user has not entered "cya"): age = int (input ("how old?" Edit): This example was too small, but the survey I am doing is too long, so every test variable takes a lot of time. is. I think the easiest way to do a survey is to list all your questions, and then Use it to make dictionary of all your user details. Answer: If not in the answer ("Bye," "CA"), the answer is: "Question" [= (["gender", "What is your gender?"), Response = "" Feedback = Response to Input ("Bye", "CA"): Brake Details [Description]...

html - How to replace input text tag into plain text of it's value using C# regex? -

मेरे पास html स्ट्रिंग है & lt; td AutoTab = "true" compulsory = " सच "मान्यकरण समूह =" OU20141008-0001 "वर्ग =" bn_TextBox bn_TextBox_com i "class =" r "& gt; & Lt; span id = "निश्चित ग्रिड 1__txtSUPPLY_AMT_0_Container" & gt; & LT; इनपुट ऑटोटैब = "true" अनिवार्य = "true" ValidationGroup = "OU20141008-0001" class = "bn_TextBox bn_TextBox_com आर IME-विकलांग" नाम = "FixedGrid1 $ ctl11 $ _txtSUPPLY_AMT" type = "text" मान = "900000" केवल पढ़ने के लिए = "पठनीय" आईडी = "फिक्स्ड ग्रिड 1 __टीक्स्ट एसयूपीएलवाई_एएमडी 0" शैली = "रंग: 0; पृष्ठभूमि रंग: 0; चौड़ाई: 96%;" / & Gt; & Lt; / span & gt; & Lt; / td & gt; & lt; td वर्ग = "आर" & gt; & Lt; span id = "फिक्स्ड ग्रिड 1__txtM_AMT_0_Container"> gt; ऑटोटैब = "सच" वर्ग = "bn_TextBox r ime- अक्षम...

Spring Integration : How to know whether two and more interfaces are succeed and allow business logic go on next step? -

I am doing some integer integration for other systems and using Spring Integration. What I want to achieve is like the following: System :: A -> B - & gt; CA?? A - & gt; B. Are each seven integrated one ?? ¡B is to check whether it receives all 7 integration data. ¢ ¢ Then B should decide to remove the data that were derived from those figures. at a time ?? ¡, I can not find a way to apply it with Spring Integreton at first glance, I thought I could just make it with aggregator pattern but now, I can not make sure of traffic and how to check the logic . Please give some advice to make these things with spring integration. I want to avoid the method of implementing with hardcoding: release-strategy-expression = "size () == 7" / code>. If you need more sophistication than that, then you will need to implement a custom release strategy.

wso2is - WSO2 IS 5.0.0 userinfo endpoint ignoring its dialect configuration -

After performing the authentication against WSO2 IS 5.0.0 and talking on access token, I call the userinfo endpoint I: https: //: 9443 / oauth2 / userinfo? Schema = OpenID This correctly answers with a JWT, but uses the usual quote even if they are configured in another bid Identity.xml (for example) It seems that the user ignores the endpoint bid configuration of the interface, does anyone else have to face this problem? Is this a bug or am I missing something? I think this is not a bug because default bid for OpenAid claim according to the OpenID specification Gives UserInfo (OIDC). WS22 used the default claim bid to retrieve the userinfone as the WOSO Callim bid. But the bid of this wso2 claim should be mapped with the OpenID claim bid (). If you want to get extra userinfo from default information, you need to map properties with "" "". Otherwise it is only the default mapped properties ("phone_number", "email", "family_na...

wpf - C# - issue with custom raising events -

मेरे पास मेरा वर्ग है जहां मैं अपनी घटना को परिभाषित करता हूं: सार्वजनिक वर्ग EventRaiserUtility {सार्वजनिक इवेंट इवेंटहैंडलर अद्यतनसूची; सार्वजनिक शून्य अद्यतन LISTEvent () {यदि (updateList! = Null) {updateList (यह, EventArgs.Empty); }} सार्वजनिक स्थिर EventRaiserUtility raiser = नई EventRaiserUtility (); } और यह वह जगह है जहां मैं अपनी घटना बढ़ाता हूं: EventRaiserUtility.raiser.updateListEvent (); और अंत में यह वह जगह है जहां मैं श्रोता बनाने की कोशिश कर रहा हूं: ... EventRaiserUtility.raiser.updateList + = नए इवेंटहाँडलर (raiser_updateList) ; // दूसरे वर्ग की init विधि में रखा ... निजी शून्य रहित raiser_updateList (ऑब्जेक्ट प्रेषक, EventArgs ई) {connType = MainWindowViewModel.getTTC (); } बस: इस घटना को सूचित करना होगा जब एक सूची अपडेट की जाती है और फिर getTTC () के साथ raiser_updateList । लेकिन raiser_updateList कभी भी नहीं कहा जाता है। क्यूं कर? कोड के सभी 3 स्निपेट 3 अलग-अलग वर्गों (एक ही परियोजना) में हैं, लेकिन यह कोई समस्या नहीं है ... सही? आ...

java - Using Comparator in an object -

मेरे पास आयु नाम वाला क्लास है, जिसमें विशेषताएँ वर्ष है, महीने और दिन । मेरे पास आयु उदाहरणों की एक सूची है मैं उस सूची से अधिकतम आयु खोजना चाहूंगा ऐसा करने के लिए मैं Comparator वर्ग का उपयोग करना चाहूंगा। किसी भी मदद की सराहना होगी। आप एक तुलनित्र लिख सकते हैं जो इस तरह से कुछ दिखाई देगा: तुलनात्मक & lt; आयु & gt; AgeComparator = नया तुलनात्मक & lt; आयु & gt; () {@ ओवरराइड पब्लिक इंट की तुलना (आयु 1 आयु, आयु उम्र 2) {अगर (उम्र 1.getYear)! = Age2.getYear ()) {वापसी age1.getYear () & lt; Age2.getYear ()? -1 1; } और अगर (age1.getMonth ()! = Age2.getMonth ()) {वापसी age1.getMonth () & lt; Age2.getMonth ()? -1 1; } और अगर (age1.getDay ()! = Age2.getDay ()) {वापसी age1.getDay () & lt; Age2.getDay ()? -1 1; } और {वापसी 0; }}} पर क्लिक करें

php - Storing a multidimensional array from another array and calling it in a foreach loop -

I have a shopping cart build problem, most code is working, not just the last part for each loop Go I believe the problem is some kind of array that is being overwritten. A quick overview of what's happening A shop item foreachloop (To avoid confusion I would call it for 1) Option, the array containing information about each FOR1 item is created only on a submit button, Because this is the time when an item is added to the car. The data needs to be stored in one session. (* Start session function is already called at the top of the page) if (isset ($ _ POST ["submit_1"])) {$ color = $ _POST ['color_select ']; $ Size = $ _POST ['size_select']; $ Value = $ _POST ['value']; $ Range = $ _POST ['Category']; $ Item_array = array (0 = & gt; array ('i_color' = & gt; $ color, 'i_size' = & gt; $ size, 'i_price' = & gt; $ value, 'i_range' = & gt; $ Range)); $ _SESSION ["items...

php - Design Pattern for Multiple Payment Providers and notifying different users based on the implementation -

I'm trying to come up with a simple way to add multiple implementation of payment providers in the system, which is only for one Uses Now I have to link a company object to a membership . There are items related to multiple invoices in a membership can be associated with one subscription only one payment provider interface But we will have the option of changing the payment provider to subscribe to the subscription generated by the Payment Provider Interface factory. The problem is that the reason for applying different PaymentProviderInterface to the user is to be different, for a particular PaymentProviderInterface I would send an email to our system instead of a real end user, for the stripe, email should be sent to the user connected to the Strip Account. For the second service the user is stored in the company object. Is the PaymentProvider object associated with Subscription ? Billing Address is the same thing. The way we retrieve the billing...

glob - Python: Open all files that do not match a pattern -

I am trying to open all those files in a directory that does not match a pattern. The directory will contain files such as x_0192910, y_18329123 and z_00000000; I want to open all the files which are not ending in '00000000', I am trying to use glob.glob (8) zero, but I can not find regex correctly I * ^ 0 {8, 8} and * [! 0] have tried things like, but I am not sure about constructing the right expression. In short, I just want something like glob.glob ('no * _00000000'). Can anyone help? Have you thought about filtering the list that is glob Returns? Something like this: glob.glob ('*') for E : if e [-9:] == "_00000000": Continue # / Code>

git - JGit: BundleWriter Error when including Refs -

I am trying to create a git bundle of a repository using JGIT bundle vaator. I am trying to include all the rifers in my bundles like this: repository repo; // Valid repo bundle vitae bundle from somewhere else; = New bundle water (repo); Maps & lt; String, referee & gt; RefMap = repo.getAllRefs (); For (reference ref: refMap.values ​​()) {bundleworld included (ref); } Jazz throws an exception for the symbolic HEAD ref, which refers to the default branch (RFS / head / master) java. Lang.IllegalArgumentException: Invalid Referee Name: org.eclipse.jgit.transport.BundleWriter.include at HEAD (BundledWire. Java: 132) If I leave head symbolic ref then bundle It is fine, but, when bundled is cloned, the missing head reference causes the following error: Warning Ni: Remote head refers to any ref, unable to checkout I can manually check things back to normal but this is not ideal behavior because The bundle is being sent to other people who would expect it to work...

java - How can I test idempotency of a method with junit? -

I have to do idempotency of a method. Let us know that I have a class person with the following method: public string doSomething (string A) {// Some person's stuff dao. Delete (A)} And I need a test when something goes wrong before forgetting, the next time you call the method, something will make the same result as you When you wanted to walk the right way first. This might be for example when you run the script that calls the method, but stops the script to fail for example. Can you do this in a unit test? Thank you in advance / div> take the exam The bar method should be run. The result / result should be similar in both cases. It's really that simple. Pseudocode: setupException (); DoSomething (a); AssertOutcome (); DoSomething (a); AssertOutcome ();

arrays - Android - Spinners -

I have a question and know that it has been called one million times, I am quite new to Android programming. So I'm kinda boggled I've created two parallel arrays -. The phrase containing spinner in two languages. As it changes in value (from array 1) - TextView translation should be updated with sentence (in the second array) Two arrays string.xml, below to the same And the spinner gets value from there. & Lt ;. String array name = "Array_Name" & gt; & Lt; Items & gt; Phrase1 & lt; / Item & gt; & Lt; Items & gt; Phrase2 & lt; / Item & gt; & Lt; Items & gt; Phrase3 & lt; / Item & gt; & Lt; Items & gt; Phrase4 & lt; / Item & gt; & Lt; / String array & gt; I'm not sure how to go about doing this or if it's a viable way of doing this ... but I'm doubling .... Anyone help please? You should install OnItemSelectedListener change spinner text spinner.setOnIte...

jQuery validation error on IE8 -

Image
I'm getting the 'object does not support this method or property' error on IE8, that line of code is given below Is: $ ('# example-advanced-form'). AjaxForm ({target: '.success', success: work () {$ ('.success'). FadeIn ('fast'); $ ("# contact_form") toggle ("sharp");}}); Due to this I am using it because FormData does not work below IE10. Here is a screenshot of the error: Here's the full script ... & lt; Script type = "text / javascript" & gt; Var form = $ ("# example - advanced-form"). Show (); $ ('# Role') Validate ({// start the plugin rule: {role: {required: true,}}}); Form.steps ({HeaderTag: "H3", BodyTag: "Fields", Transition Effect: "Slide Left", Onset Changing: Function (Event, Current Index, New Index) {// Elleva also allows past action , The current form is not valid! (Current index> New index) {true true;} // In some...

python - Appending a value to an empty list according to conditions -

I have a table with many columns. I am interested in only two columns, call them A and B. I want to create an empty column, say c = [] and add it according to some situations. AB11011 12 12 14 14 13 12 12 Take the above table as an example. If the value in column A == 1, then add the value of B to which for A == 1, column C (empty list) appears in column A. until the next A == 1. The next value of 1 in column A, above. Then I would like to see my column C like this: ABC 1 10 10 11 11 10 0 12 10 1 09 09 0 14 09 0 13 09 1 12 12 As you can see, for the first A == 1, B is the value of B in which for A == 1 next A == 1 appears it happens. I was trying something like this, but it is not working: i in: if i == 1: C .append (B [A == i]) But lose it through my entire column A and connects several lists I'm about to do it How can i go a = [1,0,0,1,0,0,1] b = [10,11,12, 9, 14, 13, 12] C = [] temp = B [0] # For the boundary, start a floating variable in th...

json - django rest-framework api and unicode characters -

I am using the DJJO-Rest-Framework to create an API for my application. My application uses Greek characters as the values ​​of my model I have created my ideas and used the Unicode JSON renderer to return Jason result. Classes chapter Vivetate (viewsets.ModelViewSet): queryset = Chapter.objects.all () serializer_class = Chapter Serializer Renderer_class = (Unicode JSNRander,) Jason is back, but the Greek letters are not recognized by the browser ("Ξ ΟΟΟΞΈΞΟΞ ·)." On the Dev console of Chrome, however, the preview of the feedback on the Network tab normally shows the Greek letters. Recognized This is a browser issue. UTF for JSON content -8; Django Rest Framework is encoding your JSON is properly in UTF-8, but your browser does not display it correctly. Content-Type in charset = utf-8 HTTP header. However, the idea defines, therefore it should not be used. Django Rest Framework respects it by not including it. For one, but unfortunately nobody cared. Lo...

windows - TaskList command hangs up while using in batch file -

I'm trying to use a tasklist.exe utility to search an operation using a batch script. I am Remote is running on the server I am using the following command tasklist / s 192.168.1.246 / u myusername / p mypassword / FI "IMAGENAME eq Oracle.EXE "& gt; When I try to execute the commands given above from the command prompt directly, it executes and returns the desired output image Name PID Session Name Session # Mem Usage ======================================= ======== == ======================= oracle.exe 4988 console 0 5121392 But when the same command is please Regards Change your batch name to tasklist.bat to anothername.bat or add .exe In not line of code: tasklist.exe / s 192.168 ...

Laravel 4 - Seems there is a Bug -

When I check syntax for laravel files, I get an error in the following file. Please help me with something on it . PHP fatal error: recluse iconv (in the seller) patchwork / utf8 / class / patchwork / utf8 / Function defined in Iconv.php Basic php functions The implementation of The file iconv.php is used only when the iconv was not compiled with php. When you run, you will see a similar error php -l patchwork / Utf8 / bootup / mbstring.php php -l patchwork / Utf8 / bootup / utf8_encode.php php If you want to delete the error, then without you Php can recompile. But you should not really do this, remove these 4 files from your syntax check script.

android - Qt TouchBegin touchPoint.pos() is stuck at 0,0 -

After I'm coding when an Android app and TouchEvent in my QT emits touchEvent-> gt; (NewPoint) on contact sources () .pos () is always 0,0 as long as I take it in my finger and force the touch update event. Is there a way to get status on TouchBegin? Below is my event code: bool event (QEvent * e) {switch (e> type ()) {Case: QEvent :: TouchBegin: touchEvent = static_cast & lt; QTouchEvent * & gt; (E); Touch touch (); Touch update (); Back true; Case QEvent :: TouchUpdate: touchEvent = static_cast & lt; QTouchEvent * & gt; (E); Touch update (); Back true; Case QEvent :: TouchEnd: touching touch (end); Back true; Default: Return QWidget :: event (e); }} OK, I solved it. I was using the touchEvent.touchPoints (global position) when I needed to use it. (CurrentPoint) .pos () X () or .y () and if it was in a frame or widget i need to get global position from that point

matlab - Anyone explain me the working of this code -

This program shows the original image, scaled image, and crop image but how the code image is scaled I Can not understand code work and logic Can anyone here tell me how this code works? thank you in advanced. [row, cola] = size (take); Scale_Rows = 2 * line; Scale_Cols = 2 * cola; Scale_image = Zero (Scale_Rows, Scale_Cols); I for = 1: line for Jammu = 1: colonel scale_is (i * 2, j * 2) = take (i, j); End capacitance conv_mask = [0.25 0.5 0.25; 0.5 1 0.5; 0.25 0.5 0.25]; Fin_lane = take; the figure; Imshow (fin_lena); Title ('scaled image'); The code here starts by repeating the size of the image in the context of coordinates: , So if the original image ABCD this Then it happens: X is an empty pixel. The code fills (interpolts) taking a combination of pixels around its surroundings with empty pixels: conv_mask = [0.25 0.5 0.25; 0.5 1 0.5; 0.25 0.5 0.25]; So this means that for the pixel you currently weigh 1, 0.5 for any pixel that is immediate...

node.js - Is it possible to svn checkout in a database -

I am writing a small webpage, which allows users to browse through a visual SVN server. I would like to add an online editor like Gitub to this webpath so that users can edit the file online, leave a message and appear in the repository. For this, I need to check out the files locally. I thought that they should be checked in a monod, so I can save the copy per user as a local work copy. Is there a way to create a checkout in a database (without re-implementing the svn protocol) or even just memory and then write it into the database. If there are any questions, just ask :) Btw If there is any interest, then this code is svn checkout directly from the database but there are some options. First of all, you can simplify the virtual disk which remains in memory and checkouts in that disk. You can store files checked files in the database. Another option is to use the Rich Subversion API directly. Please note that the subclass has been written in C, so you need to ha...

android days between two datetimes -

I have two days 09/01/2014 and 09/10/2014. I want to check the day between the day. I have written that the function witch can change that-time format public static string dateFormatary look (string inputdate) {string input format = "mm / dd / yy"; String output = format = "d MMM"; Date pars = zero; String output = "" = "; {SimpleDateFormat df_input = New SimpleDateFormat (Input Format, New Locale ("N", "US")); SimpleDateFormat df_output = New SimpleDateFormat (Output Format, New Locale ("N", "US")); Parse = df_input.pars (inputdate); Outputdata = df_output.format (parsed); } Hold (exception e) {outputDate = inputDate; } Return the output output; } But I do not know if someone knows me how can I solve my problem, please help me public string getDateDiffString (date of one date, date date two) {div class = "post-text" itemprop = "text" Long time = 1One.getTime (); Long two = da...

rope - RopeGenerateAutoimportCache on vim startup -

I would like to run RopeGenerateAutoimportCache every time I open my dragon project before working RopeAutoImport if I If I run RopeAutoImport before caching the project module, I get the following error: The global name my_func was not found! Is it possible to generate cash on each start startup or preferably to read the cache again? Thank you! I went back to Python mode (which is a suggested plugin for Python) and found a problem in code for which, when writing it, I have a patch to merge: github.com/klen/ Python-mode / pull / 488 Now I'm not seeing this problem with the patch code.

sql - Collation help needed -

I have a problem with matching a stored procedure, so I think that this issue is in this section, but I There is not enough information about the coordination to solve it, tried to add it to different sections, but it is not working. It should not go into this section so I can see the rest of the query as I should add it anywhere that I have used the temporary table The matching issue has been:? "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" table #tmp_NoRotadayOff (DayOfYear datetime, Rota varchar (10), RotaTemplate varchar (50)) to Note: I modified the original code to extract some of its code has been really affected only the left bit and due to this reason The default matching example for tempdb is compilation. You can use the current database default match to temporarily Column level Likaon are DATABASE_DEFAULT can specify. Try: table #tmp_NoRotadayOff (DayOfYear datetime, Rota varchar (10) Impedance DATABASE_DEFAULT, RotaTempla...

html - JavaScript code is not working -

I am trying to code it, such as when I uncheck the check box, read drop-down menus only But currently only the second drop down menu is read, the first is not only read and editable, here's the problem? Why not read the first drop down check box only? & lt; Html & gt; & Lt; Top & gt; & Lt; Script type = "text / javascript" & gt; Function myFunction () {document.getElementById ("1"). Disabled = false; } Function mySecondFunction () {var ddl = document.getElementById ("1"); Var selectedValue = ddl.options [ddl.selectedIndex] .value; If (selected value == "exception, where") {document.getElementById ("mySelection"). Disabled = true; // set default document.getElementById ("mySelection"). Value = "OptionZero"} {document.getElementById ("mySelection"). Disabled = false; }} Function myThirdFunction () {document.getElementById ("mySelection"). Disabled = true; // set d...

android - Attempt to reopen an already-closed object -

Image
I have three dataset classes for a database assistant class and three tables in the same database, through many async Tasks Databases are used in places. I had to face an "attempt to reopen closed objects ..." problem ... Problem, I searched around and found that dbhelper.getReadableDatabase () was already opened Returns the same object for the connection. I have guessed that when two threads operate simultaneously and one of them finishes its work and calls close () then the connection stops and the thread that flows throws this exception is. Therefore, to avoid off () I have written the following two methods: public static synchronized zero newOpenRequest () {requestsOpen ++; Util.debuglog (TAG, "Open Request:" + Request Open); } Public stable synchronized boolean canClose () {requestsOpen--; Util.debuglog (TAG, "Open Request:" + Request Open); If (requestsOpen == 0) return true; return false; } In all three data source classes, when I do...

objective c - Convert CFStringRef to NSString -

I'm trying to get some information from the main bundle: - ( Zero) AppDiffinish Launching: (NSNation *) An Information {CF String Reef Bundle Veer = CFBundleget ValuenfoSatica (CFBundlegetMeNbundle (), KCFBundLavarian); NSString * Apes = (__breeze NSString *) bundle; } I can get CFStringRef (in debug I can see the appropriate value associate for variable), but when I put it in NSString in my app version variable "zero" value I try to I am using ARC. EDIT: It seems that I have a problem with my project, not every NSString object can be assigned with a simple static assignment, the value of the test variable (zero) NSString * test = @ ""; cf stringerform boundway = cfbundlegate valffor infosystems (cfbundlegate mannebundle), kcfbundelvarsian ); NSString * Episode = (__breeze NSString *) (Bauveveler); is working on my behalf, it is returning "2"

javascript Convert string representation of hex value to hex -

How can I represent the hex value string in the representation of hex in javascript? Am I returning from the checksum routine? I have a string value of "FE". I need this hex representation "\ xFE" I just can not do this because it gives me a Returns the error: var crc = "FE"; Var hex = "\ x" + crc; This just gives me a new 4 character ASCII string: var crc = "FE"; Var hex = "0x" + "FE"; Thxs for any guidance. like var hex = parsient ("ff" 16);

vba - Creating a macro in Excel that compares two columns, answers in third column -

Image
I have not found a suitable answer for this question and I am very new to VBA, so I hope someone Will help me out I am trying to create a sub in my macro which compares a simple value between two columns, row to row If they are an exact match then it will populate a third column with "yes", otherwise it will say "no" All columns are within an Excel table and have similar lines, the example of this would be the result (Not enough representative to post image): I was thinking like something for every statement, but I'm not sure that it's the right way How are made. Thank you for your time before times! Compare the quick sub-root and the result between loops between 1 and 20 loops: i = 1 to 20. If Sheet 1. Ranges ("A" & amp; i) .value = sheet1. Range ("B" & amp; i) .value Then Sheet 1.Range ("C" & amp; i) .value = "No" Other Sheet 1. Range ("C" & amp; i) .value = "Yes...

exe4j - install4j: Whitespaces in vm-parameters via vmoptions (OSX service launcher) generating error -

We are building a service launcher for our app. In the Vmoptions file, we set a parameter that contains whitespace (like file path): -Dmy.parameter = my file path This service does not work in the launcher -Dmy.file.path = "My file path" Both generations "Main section could not be found: file. Path " This is the limit of service launchers on Mac OS X which Install4j 6 will be fixed in As a workaround, keep the VM parameter in place with the location in the first line in the .vmoptions file, then it should work.

jquery - Loop for custom attr -

I am looking for that loop which is 1, 0.8, 0.6, 0.4, 0.2, 0.2, 0.4, 0.6, 0.8, 1 and add to custom etter "data-depth" li element i and I for (var i = 0; i & lt; 5; I ++) {$ tiles.eq (i) .attr ('data-depth', - (i * 0.2-1)); } Then the first part "1, 0.8, 0.6, 0.4, 0.2" Can anyone help me? Edit Powerful community can increase this question, I have not written my efforts to solve my question (which I am sorry), some people helped me and I am very good for them. A repetition Version ... var number = 0; Var i = 1.2; Var al = jQuery ("UL"); Var phase = -0.2; While (count> 50) {if (i === 0.2) {If (step = 1) {if (Phase> 0) {i = 1.2; Phase = -0.2}} i = Math Plain ((i + step) * 100) / 100; Ul.append (" " + I + "& lt; / li & gt;"); Count ++; }

Crystal report ignoring ODBC server -

I am trying to configure the crystal report to read connection data from Odbi, so read this required database However, .rpt always connects to the server where it was created, ignoring the Odvc configuration (or, at least, the name of the server). i tried to update the connection and change the oDBC, but still the first server was asked that it was connected. Is there a way to check whether the connection has been embedded or to read the entire connection of the report from ODBC? It happens with most reports on which I'm working (about 100). I am using SAP CR13, and the report was migrated from CR8 Thanks! open CR without a report, go to file , Log on or off server and this Data Explorer Windows. At the same time you can delete your old connection (right click on connection and delete connection ) and leave a new one. Then, when you open the report, then it should be new to it. One more thing that you can try is database, set database location ... an...

Multiple specialization, iterator patterns in Rust -

Learning rust (yay!) And I'm trying to understand idiomatic programming as essential for some iterator patterns, while top scoring performance. Note: Rust is not an Iterator feature, there is only one method which I have accepted to close and applied it to some data, I am pulling out of disk / memory. I was delighted to see that Jung (+ LLV?) I took an iterator written for sparse matrix entries, and one stop to multiply sparse matrix vector, iterator.map_edges ({| x, y | dst [y] + = Src [x]}); and underlines the body of the closure in the generated code. It went very fast: D If I make two of these, or use it for the first time (not a problem of correctness), each instance is slow enough (this case Approximately 2x in), possibly because the adapter number now chooses to gain expertise because of many call sites, and you are calling function for each element. I am trying to understand if there are idiomatic patterns which have a pleasant experience (I at least without...

javascript - underscore/lodash - combine objects with same elements -

I'm trying to lack better words 'zip' or 'merge' json objects in each single single reacting element on the basis of . Example: var obj = {CATS: [{id: 123, LIST: [{Result 1: CAT1}, {result 2: cat 2}}}, {ID: 987, List: [Results 1: CAT3}, {Results 2: CAT4}]}, DOGS: [{id: 123, LIST: [{Result 1: DOG1}, {result 2: DOG2}}}, {id: 987, LIST: [result1: DOG3}, {result2: DOG4}]}]} I would like to use nested 'id' within obj to create: var New_obj = {123: [CATS: {LIST: [{RESULT 1: CAT1}, {RESULT 2: CAT2}}}, DOGS: {LIST: [{Result 1: DOG1}, {Result 2: DOG2}]}, 987: [Cats: {LIST: [{result1: CAT3}, {result2: CAT4}}}, DOGS: {LIST: [{result1: DOG3}, {result2: DOG4}]} }} for LoDash or underscores Part ... whatever works thanks! ** WARNING! IO 8 should be compatible. Bleh! ** Wow, after some testing and error, what do I need for you ... var results = _.readuce (obj, function (memorandum, group, key) {var ids = _.map (group, function (g) {return g.id;});...

jsf 2 - Block entire page -

When I change the page (pages 1 to page 2) there is a slight delay and it is possible to click on another button and These work go on. So I want to block the page during waiting time to load the following page, how do I do it? I use jsf2 and primfaces. At this time already blockUI and blockUI - extensions - & gt; Do not work You should tell us. Why is p: blockUI not working? Try it out This is a job. page1.xhtml & lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt ;! - To change this license header, select the license header in the project properties. To change this template file, tool | Open templates in templates and editors. - & gt; & Lt ;! DOCTYPE html & gt; & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" xmlns: h = "http://java.sun.com/jsf/html" xmlns: f = "http: // Java Sun.com / Jsf / core "xmlns: ui =" http://java.sun.com/jsf/forums "xmlns: p =" http://...

mercurial - hg unbundle failure: journal:dirstate journal.branch store/journal -

I have been working with some repository reinstatements which were in repositoryhosting. Some of these treasures are in Mercury, with whom I am unfamiliar. I am following to share the repository on my new machine, but failed. Repeated attempts have failed, the messages are as follows: myhost: repo / path $ hg unbundle path / to / bundle abort: Operation is not allowed: / path / to / my / Repo / Hg / journal.dirstate myhost: repo / path $ hg unbundle path / to / bundle abort: Operation not allowed: /path/to/my/repo/.hg/journal.branch myhost: repo / path $ Hg unbundle path / to / bundle expiration: Operation not allowed: / path / to / my / repo / hg / story / journal hg help bundle Not helpful, I think the answer is probably simple, but it does not know where The Kna. You can just click hg clone & lt; Bundle-file & gt; & Lt; Dest> .

osx - Dont want to have to start mongod with `sudo mongod` -

I just got brew install mongodb with OS X 10.9.5 on Brandi's new MacBook Air. I tried to run mongod from the terminal and he said "no / data / db" so I used to call it sudo mkdir / data and Sudo MkDir / Data / DB . is now running "Unable to create / open lock file: /data/db/mongod.lock error: 13 permission is denied" but I can call it sudo mongod . How can I make it so that I do not have to run Mongoode with pseudo, but instead just mongod (I was like this That's on my last computer, but I do not remember what I did, and that computer had messed up everything.) This worked for me: sudo chmod-r 777 / data / db then makes Sudoku chown-r_ id -u` / data / db -R command recursive; I tried to direct the other stack overflow answers as both sudo chmod 777 / data / db and sudo chown `id -u` / data / db but They failed. (PS I'm sorry, I know this is a very old question, but I found myself trying to see the answer to ...

python - Permutations of the elements of two lists with order restrictions -

I would like to merge two input lists together and get all the permutations of their elements that the order of the elements of each input For example, if I have two lists: ['b', 'a'] and ['c', 'd'] , I would like to get the following lists: , ['B', 'A', 'C', 'D'], ['B', 'C' 'A' , '' 'B', '' '' ',' '' ',' '' ',' '' ',' '' ',' '' ',' '' ' 'D', 'A'], ['C', 'D', 'B', 'A'] where the sequence of elements of the elements are retained (comes before the BA, comes before cd). I have a problem that has been encountered in dealing with such a problem, but is being used as stars rather than lists:. For example, "BCD", "BCAD", "BCDA", "CABEd", "CBDA", "CDBA" wi...

sql - How to find hour in getdate() is expired -

In my DB I have submitted time in the form of time, on my asp.net page, I want to retrieve it and Detected whether the recovery period has expired or not. The end time is 8 hours, what is the best way to do this? I have tried this way but did not get the proper solution datetime DB_time = convert. ToDateTime (dr_pass [2]. Ostring ()); // Time from the database if (db_time * datetime.now.addhours (-8)) // password is too old {return; } And {return true; } datetime db_time = convert toDateTime (dr_pass [2] .tostring ()); // Time database if (datetime.now> db_time.AddHours (8)) {return true; // password is valid} other {return false; // password expired}

Ruby example of Net::HTTP for GET, POST, PUT, DELETE -

I am trying to learn Ruby for the first time. I have some experience in PHP and PHP, I have created a function such as function call_api (endpoint, method, arr_parameters = '') {// a curl call} How will I use call_api ('https://api.com/user','get','param=1&ampur=2'); Call_api ('https://api.com/user/1','get'); Call_api ('https://api.com/user/1','post','param=1&pparam=2'); Call_api ('https://api.com/user/1','put','param=1&pparam=2'); Call_api ('https://api.com/user/1','delete'); So far, I have only learned how to make a GET and POST call with Ruby: conn = Net :: HTTP.new ( API_URL, API_PORT) resppost = conn.post ("/ user", 'param = 1', {}) respget = conn.get ("/ user? Param = 1", {}) But I do not know how to delete and insert. Can someone show sample code to destroy and call with Net :: HTTP objects? You only na...

gcc - C beginner - Hello World program not doing anything on Windows from command prompt -

I am going to start learning C (I need to do some program in C, to convert it to MIP later for). I am on Windows 8, and downloaded Minzid and set the path variable in my directory so that we can work on GCC or G ++ command prompt. I have copied the following namaskar one. Example of the world in a C text file. Add # & lt; Stdio.h & gt; Int main (zero) {// This is a comment printf ("Hello World! \ N"); Return 0; } However, although I am in the correct directory as the file, at the command prompt, when I type "gcc helloWorld.c", it stops for a few seconds, and Then 'Nothing works just as the program has ended and allows me to write something else. This is likely to be a simple mistake - I really do not understand what I'm doing. But can someone help me? When you issue the GCC command, you are actually compiling the source code, not the program The compiling process creates the executable file that you can run. For example, Premie...

ios - Parse Login Using Swift -

I am making a login page for my iOS app using swift and parse. In my initial view controller, I have var user = PFUser.currentUser () if user! = Nil {println (user) self.dismissViewControllerAnimated (1, completion: zero)} other {println} ("no user is logged in") Login: PFLogInViewController = PFLogInViewController () login.fields = PFLogInFields.UsernameAndPassword | PFLogInFields.LogInButton | View my viewDidLoad method of ViewController I want to go after login. The login screen is initially visible, and then I can type my information, but if I enter the correct login information it does not go anywhere, since that time restarting the app gives me permission to log in . I want to be able to log in to the app without restarting, but how does it know. You just have to implement - (zero) log invent Controller: (PFLog Invuentrator *) Log In Controller Logged User: (PFUser *) User {[Self-Captive View Controller Permission: Yes Completed: Zero]; } which is call...

plugins - How to add ADMOB banner to Unity? -

I tried to use the guide provided with the official plugin but I failed to understand either the banner ad Or how to add instructions is very unclear Does anyone expose me in a slightly better way to add banner to one of my 2D game scenes? Create a new script in C # and include the following code. Using GoogleMobileAds.Api; Now you have to create a new ad and start it. Therefore, only add the following code to the initial function. // Create a 320x50 banner at the top of the screen. BannerView bannerView = New banner view ("YOUR_AD_UNIT_ID", AdSize.Banner, AdPosition.Top); // Create an empty ad request AdRequest Request = New AdRequest.Builder () Build (); // Load the banner with the request BannerView.LoadAd (request); See the entire tutorial

c# - Textbox value to database using stored procedure -

I am learning business logic and data logic and programmability. I have 1 DL (data logic) class with all stored procedures, so I have a BL (business logic) which connects DL and BL, then I have a form class where I Can I add new users to the database? How do I add forms, BL and DL? DL Class stored procedure: Insert a public dataset (string created by Int ROTID, String Rolesdesk) {DataSet mydataset = new DataSet (); SqlCommand cmdclubroles = New SqlCommand (); // Find the stored procedure cmdclubroles.CommandText = "usp_insertrlubroles"; Cmdclubroles.CommandType = CommandType.StoredProcedure; // Connect cmdclubroles.Connection = jadcoreConnection.GetConnection (); // parameter cmdclubroles.Parameters.AddWithValue ("@RillID", Convert.ToInt32 (RoleID)); Cmdclubroles.Parameters.AddWithValue ("@Roledesc", Roledek); Cmdclubroles.Parameters.AddWithValue ("Manufactured by", manufactured by); SqlDataAdapter mySqlDataAdapter = New SqlDataAdapter (...

python - Re-encode Unicode stream as Ascii ignoring errors -

I am trying to take a unicode file stream, which contains strange characters, and wrap it with a stream reader It will convert to Eski, ignoring or altering all those letters which can not be encoded. My stream looks like this: "EventId", "Rate", "Attribute1" "Attribute2" "(�� ?? ½½¡|¾ ?? " ... My attempt to change the stream on the fly looks like this: Import charts, oo, codec with open (self.csv_path , 'Rb') as rawdata: detected = chardet.detect (rawdata.read (1000)) with encoding = io.open ['encoding'] [ccv_file (as self.csv_path, 'r' , Encoding = detected encoding) csv_ascii_stream = Codecs.getreader ('ascii') (csv_file, errors = 'ignore') logs (csv_ascii_stream.read ()) log The result on the line is: Unicode encoding error: 'ASCI' in the codec condition. Can not encrypt the transformations. 36-40: Not in serial number (128) Even if I have explicitly created th...

c++ - Accessing protected variable in googletest -

मेरे पास यह कक्षा testC है जो Google परीक्षण के लिए है class testC: public A {}; और उसके बाद एक ही फाइल में टेस्ट की गुच्छा है। परीक्षा (test_case_name, test_name) {... test body ...} ए इस तरह संरचित है वर्ग A {protected: B b; सार्वजनिक: // कन्स्ट्रक्टर // डिस्ट्रिक्टर // सदस्य कार्य प्रश्न: मैं b में सभी तक पहुँच कैसे कर सकता हूँ? TEST () {} कार्यों के माध्यम से testc मैंने testc सार्वजनिक में एक getter करने की कोशिश की: testc getTest ( ) {टेस्टसी टेस्ट; वापसी परीक्षा; } और मैंने भी एक संदर्भ वापस करने की कोशिश की, लेकिन कोई भाग्य नहीं ... मुझे लगता है कि आप googletest द्वारा प्रदान किए गए FRIEND_TEST मैक्रो का उपयोग कर सकते हैं नीचे उन्नत गाइड में देखें। असल में आपको परीक्षण के अंतर्गत कोड के एक दोस्त के रूप में परीक्षण घोषित करना होगा। अगर मैं गलत नहीं हूं तो आपको उन सभी परीक्षणों के लिए दोस्ती की घोषणा करनी होगी जो सुरक्षित सदस्यों का उपयोग करना चाहते हैं। UPDATE : बेहतर लिंक के लिए धन्यवाद; -) इस दृष्टिकोण से मुझे क्या नाराजगी है कि...

regex - Find n occurrences from group of characters -

Looking at the string, I think of printing "two" if I group xyz . given jxyl print two given jxyzl print nothing Jxxl print two I am very new to Pearl, so this is my view. my $ word = "jxyl"; @char = split //, $ word; My $ size = $ # four; $ Char eq for "z" ($ i = 0; $ i From the general question: perldoc -q count Use warnings; Strict use; While (& lt; data & gt;) {chomp; My $ count = () = $ _ = ~ / [xyz] / g; Print "$ _ two \ n" if $ count == 2; } __DATA__ jxyl jxyzl jxxl Output: jxyl two jxxl two

Scala list of list count different elements per sublist index -

I have a list of lists with the following data val list = list ( List ("A", "A", "A"), List ("A", "B", "C"), List ("D", "E", "F"), I want to understand that there are many different figures of each Spibs 1 - & gt; List ("a", "d", "a") 2 - & gt; List ("B", "E", "A") 3 - & gt; List ("C", "F", "A") Is there any way to do this? It does not need to be indexed, but I'll copy the index requires different values, can be found 2 // different values ​​A and d 3 // Various values ​​B, E and A 3 // Various values ​​C, F and A transpose of the above Can c, and then "itemprop =" text "> varies to remove duplicate : scala & gt; List.transpose.map (_Special.size) res0: list [int] = list (2, 3, 3) If all lists are not there then it will throw an ex...

Primary key design in SQL Server -

Right now, I'm designing the database as you know, primary keys are important factors in database design. There is a dilemma in deciding the primary key between GUID, identity (auto increment) and a custom key for the primary key, in which case should I use? I am trying to design a database for the school. There are various schools in the school and many branches in different cities are the central database of the school, they want to update every evening. Please guide me? Thanks In my opinion, the default option is to use a 32-bit integer with auto-increment You can use the GUID under the specific scenarios included in this QA: A custom key should be used only if you have any reason based on your design Need to specify a specific key for or based on business needs. EDIT: Depending on your updates, if you are merge disconnected tables you may want to consider using the GUID key so that you do not have problems with collision.

json - Weird output coming from express' req.query -

I am calling a AJAX to call server-side process of some nodes. This is my data object var data = {field1: value1, field2: value2} And sending data: Data to call using JSON.stringify (data) In the path of my node , Req.query as follows: {'{"field1": "7", "field2": "7"}': ''} I can not get the values ​​using req.query.field1 , how can I format this output so that I can move forward? The problem is not being set properly from your request headings (Content Type: JSON), because You are sending a string. To show your post that you are using jQuery, you do not need to empower your data, send it as JSON and jQuery, set the right title: $ Ajax ({type: post}, url: "/ someurl", data: {field1: "7", field 2: "7"}}) done (function (msg) {warning ("data saved:" + msg );});

c++ - CERN root - error when filtering events for subtree based on time -

I had asked this question before the official route (CERN) forum, but the problem is still unresolved. Maybe someone can help me, point my fault or suggest alternate method? I have a TTR with incidents; In TTRE, each program has a branch with unix time and some other branches. I want to choose a subset of events based on a time interval so that I can analyze them separately. To make the selection, I make another tree and copy all entries within the correct time interval. The following code works perfectly well and copies the copy of all the events from the tree: void tree_time_filter (TTree * tree, TTree ** subtree, Int_t time_i, int_t time_f) {* subtree = tree-> clonitory (0); Int_t t; Tree-> Setbank Academy ("Unix Time", & amp; t); (Long 64_t i = 0; i & lt; tree- & gt; GetEntries (); i ++) {tree-> gateenti (i); If (true) {(* subtitles) - & gt; fill (); }} Cout & lt; & Lt; "Tree-filtered." & Lt; & Lt; (* Subtree) ...

amazon web services - Why does Elastic Beanstalk create new EC2 instances when I change my EB settings? -

If I make a configuration change in the Amazon EB interface (for example, changing the EC2 key / pair or monitoring interval) , The EB will close the current EC2 example and create a new one. Why does not it use the current EC2 example? Is there any implication for accumulation of EC 2 examples? Some EC2 example properties (key pairs and others) are irreversible, therefore elastic beanstock need to be made a new one. Excluding property replaced with similar properties. There is no implication for the collection of finished examples, but it will charge for a new example. For example, if you change the property 2 times an hour, you will be charged for 3 hours.

jsf - java.io.NotSerializableException: org.primefaces.model.DefaultStreamedContent -

I have a simple JSF 2.1 which used to work fine on Java EE6 using the primaryfaces 3.4. When I migrated to Glassfish 4.0 and Primface 5.1, every time I assign the project to Netbeans: java.io.NotSerializableException: org .primefaces.model.DefaultStreamedContent java.io.NotSerializableException: org.primefaces.component.datatable.DataTable Even if this exception was thrown So, this project has been deployed and is running properly! What could be wrong? is thrown when an example of a class should implement a serializable interface. If the class that thwartes an exception is not related to a third-party library, find the class and apply a serializable interface to it. If you do not want to serialize the objects in the class, you can mark objects to make serializable runs, ignore time objects. You can read about it

c# - How to call method from all opened forms -

I want to call a method in all open forms this call call MyUpdateFnc () last Csutomer Open Form: if (application.OpenForms ["frmCustomer"] = faucet) {(application.from ["frmCustomer"] as frmCustomer). MyUpdateFnc (); } Many forms may be open. You can get the Application.OpenForms.OfType & lt; T & gt; By using the method, all the types of type you want. After this you have to run again through the form collection. For example, use the foreach loop as follows: foreach (application in frmCustomer frm. OpenForms.OfType & lt; frmCustomer & gt; ()) Frm.MyUpdateFnc ();

c - Issue with printing 2D array of structs with "\n" -

I am trying to print a 2D array strokes using printf in box formation. Each structure has an int and char value. When I try to print them, it only prints the int value, but prints four values ​​instead of printing it. When I tell the print statement, to go to a new line after the other for the loop (The printf ("\ n") terminates it, so it just prints fine (except that it is not in the formation of the box.) Is it something strange that the quark or what am I seeing? / P> for (int i = 0; i output Looks like this: 99� 99� 99� 99� 99� 99� 99� 99� 99� 99�991 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 ¿99 99 ¿½ 99 ¿½ 99 ¿99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 Here's my complete code: #include gt; # Include class.h 'void corUsage (argc) {if (argc == 1) {printf...