I have been working with this question for a while and I have a hard time getting new to SQL and I can not understand their reason is that I get this error:
message 209, level 16, state 1, line 1Ndigd column called Grahk_anmber message 20 9, Level 16, State 1, Line 1 suspect column name 'phone_number1'.
I have tried to add the column as follows, but there is no luck with it. Any help would be greatly appreciated!
If you want to get the table Grahk_nmber the kind that you must specify:
select r .customer_number Select
or
m.custo mer_number
If your final query will look like this:
r.customer_number, --or m.customer_number first_name_initial, last_name, serve_address_1, serve_address_2, serve_city, serve_state, route_serve_zip_code, phone_number1, the customer_master interiors route_detai Join referral_code L on m.customer_number = r.customer_number WHERE (referral_code = 'American')
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
scope - Externally scoped variables in IronPython delegates -
In IronPython, I can not seem to get a variable out of the scope of a scope scope. Unlike what I can do in both C # and Python. In C #, I can do the following (customized) example: Public representative Bull del (Int Index); Public static zero main () {int total_count = 0; Del d = representative (int index) {total_count + = 3; Back true; }; For (int i = 4; i <6; i ++) {d.Invoke (i); } Console.light line (total_connect); // print 6} I can do the same thing in Python: total_count = 0 def Representative (index): Global total_count total_count + Range in 3X (4,6): Representative (X) print (total CPU) # Print 6 but affecting Python variables in Python The public sector Fu {Public Representative, Bull Del (Int Index), will be crashed by C # named Named : import fu total_count = 0 def representative (index): global total_count total_count + 3 = "global name 'total_count' There is a way to increase total_count in the Python rep? Without changing any of C #? < Adding an additional global line to IronPython was working in the div class = "post-text" item class = "post-text" itemprop = "text"> This function was working outside of the representative. Not required: Public Sector Fu {Public Representative Bull Del (Inte Index); Public Static Intu Fouit (Del the_Delitat) {int for unrelated_count = 0; (Int i = 4; i import foo global total_count # this line Adding this works. Total_count = 0 def representative (index): global total_count # You also need to keep this line. Total_count + = 3 Return True unrelated_count = Foo.FooIt (Foo.Del (Representative)) Printout # Print 6
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
spring - Best practice to access and display data from DB that is
common across all pages -
I define Spring MVC controllers for each JSP page, such as HomePageController, CategoryPageController, ProductPageController, CartPageController etc. Along with a webstore. And all these controllers call DB to bring and display menus at the top of the JSP pages. Call DB to bring each of the mentors mentioned above. I'm using the spring 3.0 framework. HomePageController.java @Controller @RequestMapping (HOME_PAGE_CONTROLLER) public class HomePageController extends BasePageController {@RequestMapping (method = RequestMethod.GET) protected ModelAndView ProcessRequest (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {ModelAndView MAV = new ModelAndView (); Mav.addObject ("menu categories", masterdata service .gate all menu categories ()); Return Show Page (Maui, HOME_PAGE_URL); }} I think in a way that this call is unnecessary, because 1) all the controllers menu 2) difficult to maintain to maintain because of changes in the business logic changes There are many controllers this call will be required What is the best practice in this type of scenario? How can I get this call from multiple controllers? Is this a way to call a central location so that this piece of code does not cut into all the controllers? Avoid address duplicate controller sections - If the expansion of all controller classes BasePageController : public abstract class BasePageController {... @ModelAttribute public void initMenuCategories (model) {model.addAttribute ( "menuCategories", masterDataService.getAllMenuCategories ()); } ... Decrease database calls per page - Consider caching menu categories if they do not change too many times: @ Service Public Class MasterDataService {... @Cacheable (key = "menu", value = "menu") Public list & lt; MenuCategory & gt; GetAllMenuCategories () {...} ...} To do this you need to add a cache called menu in your service level configuration for details. See the documentation.
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
php - Ubuntu sendmail only sends to localhost -
मैंने Ubuntu 14.04 पर sendmail के साथ एक LAMP सर्वर की स्थापना की है। जब मैं मेल ("user @ localhost", "test", "test") का उपयोग करता हूं, तो मेल भेजते समय, टर्मिनल या पीएचपी मेल () से, यह ठीक से काम नहीं करेगा। यह सही ढंग से भेजता है, और मैं टर्मिनल से मेल के साथ संदेश पढ़ सकता हूं, लेकिन जीमेल पते पर भेजते वक्त, संदेश गर्त नहीं चलेगा "test" का उपयोग करते समय एक ही परिणाम। | Mail -s "test" xyz@gmail.com " सर्वर टर्मिनल से। किसी भी विचार यह कैसे तय है? मैं कई घंटों के लिए अब Googling गया है, मैंने काम के समाधान की खोज के बिना सब कुछ करने की कोशिश की है, और मैं आशा खोना शुरू कर रहा हूं। संभवत: कई संभावित समस्याएं हैं, इसलिए आपको कुछ त्रुटियों को लॉग करना होगा जो हो रहा है। सबसे अधिक संभावना है कि Google आपका ईमेल अस्वीकार कर देता है क्योंकि आपका सर्वर ठीक से कॉन्फ़िगर नहीं है।
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
mysql - Writing an sql query that uses count -
I am trying to write a query that uses SQL in the calculation. I am trying to write it The query is Find users who review at least 2 restaurants These are the tables I am using: < Pre> explain_ar_rerestant; + -------------- + ------------- + ------ + ----- + ------- - + ------- + | Field | Type | Faucet Key | Default | Extra | + -------------- + ------------- + ------ + ----- + ------- - + ------- + | Business_id | Int (11) | No | PRI | Faucet | | Type of food. Varchar (20) | Yes. | Faucet | | Total Sets | Int (11) | Yes. | 1 | | + -------------- + ------------- + ------ + ----- + ------- - + ------- + Review the review; + ------------- + --------- + ------ + ----- + --------- + - - ---- + | Field | Type | Faucet Key | Default | Extra | + ------------- + --------- + ------ + ----- + --------- + - - ---- + | Business_id | Int (11) | No | PRI | Faucet | | User_id | Int (11) | No | PRI | Faucet | | Review_id | Int (11) | No | PRI | Faucet | | Review_date | Date | Yes. | Faucet | | Star_rating | Int (1) | Yes. | 1 | | + ------------- + --------- + ------ + ----- + --------- + - - ---- Explain the users; + ------------ + ------------- + ------ + ----- + --------- + ------- + | Field | Type | Faucet Key | Default | Extra | + ------------ + ------------- + ------ + ----- + --------- + ------- + | User_id | Int (11) | No | PRI | Faucet | | Name | Varchar (50) | Yes. | Faucet | | User_since | Date | Yes. | Faucet | Any attempt made here (Ive tried a lot from this, but there is one): SELECT reviews.user_id from review JOIN is_a_restaurant ON (review .business_id = is_a_restaurant) WHERE (count (*). Is_a_restaurant & gt; 1) Reviews by Group .user_id ASC; is the error that I get There is an error in your SQL syntax; Close '.is_a_restaurant & gt; To use the correct syntax, check the manual related to your MySQL server version. 1) Reviews by Group .user_id ASC 'on Line 1 I am not a MySQL My syntax may be a little bit of man, but you probably want to use a hosting clause. Reviews. Reviews from user reviews at JOIN is_a_restaurant Business_id = is_a_restaurant.business_id GROUP by review .user_id ASC HAVING COUNT (*)> 1; The Housing Clause is like a WHERE clause, but it is used for accumulated values (COUNT in this case). The column names have also disappeared from you_a_restaurant in JOIN expression.
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
java - @RequestPart("json") as a property in ModelAttribute -
Is there a way to embed the Jasonan object in the model attribute in Spring MVC? For example on the client side: var obj = JSON.parse (user); // User is a JSON string that contains user object information var formData = new form data (); Formdata.append ("userInfo", obj); On the server side, @RequestMapping (value = "/ here", method = {RequestMethod.POST, RequestMethod.GET}, header = "Content -type = multipart / form-data ") @ResponseBody public string doSomething (@ModelAttribute MyForm myForm, HttpServletRequest request, HttpServletResponse response) {user user = myForm.getUserInfo (); }
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
validation - Validating a date in java -
I am using Netbeans IDE 7.2. I have two different classes, newDateTest.java and newDateMethod.java , I currently use one of my method classes to validate a date from a user input I have been used in my test class. So far in my test class I have the following: try {prompt = "Please enter a date in format dd-mm-yyyy"; Println (expedited); String inputdate = in.next (); IsValid = newDateMethod.validDate (input, input, input); If (isValid) {System.out.println ("valid date"); } And {System.out.println ("INVALID DATE"); }} Hold (ArrayedAxOutBoundApensionAb) {System.out.println (oob); }} Although I do not know how to validate date in my method class because I am quite new in Java Can any solution come in? The way I am taught to use is the date format but it is not sure whether it is appropriate here or not? If this does not happen then how to use it like this: < Code> Date Dates = Nil; String inputdate = "07-01-2013"; Try {dateFormat formatter = new SimpleDateFormat ("dd-MM-yyyy"); Formatter.setLenient (wrong); Date = formater PRSE (InputDate); } Hold (ParseException e) {e.printStackTrace (); }
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
java - Why can not I assign method reference directly to variable of
Object type? -
Java-8 Simple questions about syntax. Why does this restrict the expressions like JLS-8 : object at_on = stream: why; // compile-time error and allow only a few: java.util.function.function of_ref = stream :: of; Object obj = of_ref; // compiles ok ? This is because the goal type should be a method reference or a functional interface of lambda expression. Based on that only, Runtime will make an example of a class for the implementation of given functional interface. Think of Lambda or method references as a concept, assigning it a functional interface type, it gives a solid meaning. In addition, there may be several functional interfaces in the form of a particular lambda or method reference, its target type. For example, consider the following Lambda: int x = 5; Functional interface func = (x) - & gt; Println (x); This lambda is a consumer of x . In addition, any interface with an abstract method with the following signature: public abstract zero xxx (int value); can be used as a target type, so if you specify the type of lambda to be the object , then which interface you run the runtime Want to? This is why you have to explicitly provide a functional interface in the form of goal type. Now, once you have found a frequency functional interface reference, you can call it any super reference ( Object )
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
mysql - Convert dates into weeks -
How to change the continuous date in weeks, the week of Saturday should end Example: < / P> 2/27/2015 3/6/2015 3/13/2015 3/20/2015 Here I give more information about your requirement I'm so easy to understand. I have a datetime field in my db that tells Date2. Me mm / dd / yyyy This date needs to be grouped in date2 as 1/1/2015 like 20/1/2015 . 1/1/2015-3 / 1/2015 This category has been displayed as 3/1/2015, 4/1/2015- 10/1/2015 - --------------------- 10/1/2015, 11/1/2015-17 / 1/2015 ----- ------- ---------- 17/1/2015, 18/1 / 2015-24 / 1/2015 ---------------- ----- 24 / 1/2015 It is not completely clear what you are asking , Then I would guess If I feel wrong, please forgive me. Let us know that you have an arbitrary DATETIME column named Date2 , and you want to create a DATE on Sunday immediately before that value. In other words, you want to find out the week that contains DATETIME . You can do this: FROM_DAYS (TO_DAYS (date 2) - MOD (TO_DAYS (date 2) -1, 7)) So, if you have a sales table with customer_id , date2 , and sales , you summarize this way in the week You can: SELECT FROM_DAYS (TO_DAYS (date 2) -MOD (TO_DAYS (date -1, 7)) Week_bugging, COUNT (*) num_transactions, COUNT (DISTINCT customer_id) num_customers, This sale from sale group by FROM_DAYS (TO_DAYS (Date 2) - MOD (TO_DAYS (Date) -1, 7) from SUM (Sales) Total_SESS Each calendar week will show on the date of the commencement. If you want to end each calendar week on Saturday, then use it instead. SELECT FROM_DAYS (TO_DAYS (date 2 ) - MOD (TO_DAYS (date) -1, 7)) + Interval 6 days a week, COUNT (*) num_transactions, ... I have written it in detail here: You
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
python - Why do I still have optparse being used in Django v1.7.4? -
argparse is the device Django (allegedly) to parse the command line, and according to . However, now nine months have elapsed, and when I see the base demand announcement, see: Make_option, optionParser ... Option_list = (make_option ('- v', '--verbosity', action = 'store', destination = 'verbosity', default = '1', type = 'option', option = ['0', '1 0 = Minimum output, 1 = normal output, 2 = verbose output, 3 = very verbose output '), make-options (' - settings', help = '' Python path for a settings module, such as "myproject.settings. Main ". If this is not provided, then the DNANGOSSTISMAAMAMDE environment variable will be used. '), Make-option (' - PythonPoth ',' help '= DIREAC Make_option ('- traceback', verb = 'store_true', help = 'rais e exception'), make_option ('- no-color'), to add the character to the Python path, such as "/ home / djangoprojects / myproject" , Action = 'store_true', dest = 'no_color', default = false, help = "do not color the command output."),) when using Django argparse 1.7 in ? v1.8b2 has been tagged to your commitment to the stable and for the branches Looking at the source code it looks like the argparse v1.8 will be presented as the default. However, see also for v1.8. However, optparse will be created as a fallback option (to allow support released before version 2.7 / 3.2 for Python versions) until Django v2 will not be there. According to: optparse should be supported during the release of Django 1.8 / 1.9
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
objective c - xcode/ios: delegate not working with NSFetchedResults
Controller and core data -
मेरे पास तीन मुख्य स्क्रीन के साथ एक महिमाग्रस्त मास्टर विस्तार प्रोजेक्ट है: रिकॉर्ड्स के रिकॉर्ड विवरण की सूची जोड़ें रिकॉर्ड यह अधिकतर काम करता है लेकिन जब आप एक नया रिकॉर्ड जोड़ते हैं और रिकॉर्डों की सूची में देखते हैं, तो एप्लिकेशन को रिकॉर्ड की संख्या ठीक है, अर्थात अगर आपके पास एक और दूसरा जोड़ता है, तो आप देखेंगे 2 रिकॉर्ड लेकिन नए रिकार्ड को देखने के बजाय आप पहले रिकॉर्ड की 2 प्रतियां देख सकते हैं। यह तब तक बनी रहती है जब तक आप सिम्युलेटर बंद नहीं करते। जब आप इस परियोजना को पुनर्निर्माण करते हैं, तो आपको नया रिकॉर्ड दिखाई देता है ताकि इसे कोर डेटा में सही ढंग से संग्रहित किया जा रहा हो। समस्या यह है कि तालिका दृश्य अपडेट नहीं हो रहा है। बीटीडब्ल्यू, जब आप नए रिकॉर्ड के बारे में बताएंगे, तो आप सही रिकॉर्ड देख सकते हैं। हालांकि, जैसा कि उल्लेख किया गया है, अभिलेखों की सूची में जब तक आप सिम्युलेटर बंद कर देते हैं और पुनर्निर्माण करते हैं तब तक आप पुराने रिकॉर्ड की दो प्रतियां देखते हैं। मुझे इसमें सभी कोड शामिल नहीं होंगे क्योंकि यह बहुत लंबा है, लेकिन मुझे लगता है कि प्रतिनिधि के साथ ऐसा करना होगा, मैं यही कर रहा हूं। सूची में। फ़ाइल है I: @interface list: UITableViewController & lt; UITableViewDataSource , UITableViewDelegate, NSFetchedResultsControllerDelegate & gt; मेरे पास list.m फ़ाइल है: // निम्नलिखित वीसी प्रतिनिधि के लिए फ़ेच नियंत्रक में परिवर्तन की निगरानी करने के लिए अनिवार्य है जिसका प्रोटोकॉल निम्नलिखित है #pragma mark - NSFetchedResultsControllerDelegate - (शून्य) नियंत्रकडिड चेंज कंटेंट: (NSFetchedResultsController *) नियंत्रक {// change} मेरी समझ जब तक आपके पास आवश्यक विधि से ऊपर है, वीसी प्रतिनिधि के रूप में कार्य करेगी NSFetchedResultsController ऑब्जेक्ट के लिए। मुझे क्या याद आ रहा है? किसी भी सुझाव के लिए धन्यवाद।
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
javascript - How can I hide one div before opening another? -
How can I create it so that only one div can be shown at a time? I tried to add "document.getElementById (currentID) .style.display = 'none';" In the second but it does not work. & lt; H5 onclick = "showImage ('chair')" & gt; Chair & lt; / H5> & Lt; H5 onclic = "show image ('table')" & gt; Table & lt; / H5> & Lt; H5 onclic = "show image ('long_table')" & gt; Meeting table & lt; / H5> & Lt; Div id = "chair" & gt; & Lt; Img src = "picture / 1.jpg" height = "300px" /> & Lt; H4 & gt; Product 1 & lt; / H4 & gt; & Lt; / Div & gt; & Lt; Div id = "table" & gt; & Lt; Img src = "picture / 2.jpg" height = "300px" /> & Lt; H4 & gt; Product 2 & lt; / H4 & gt; & Lt; / Div & gt; & Lt; Div id = "longtable" & gt; & Lt; Img src = "picture / 3.jpg" height = "300px" /> & Lt; H4 & gt; Product 3 & lt; / H4 & gt; & Lt; / Div & gt; & Lt; Script type = "text / javascript" & gt; Var currentID = ""; Function showImage (id) {if (currentID == ID) {document.getElementById (id) .style.display = 'none'; CurrentID = ""; } And {document.getElementById (id) .style.display = 'block'; CurrentID = ID; }} & Lt; / Script & gt; Better add a class to your HTML and then take the divs by their square. Then you can loop through the elements to hide them all, and then un-hide one you clicked on. Example: var arrProducts = document.getElementsByClassName ('product'); (I = 0; i & lt; arrProducts.length; i + +) for {arrProducts [i] .style.display = 'none'; } Function showImage (id) {for (i = 0; i & lt; arrProducts.length; i ++) {if (id == arrProducts [i] .id) {if (document.getElementById (id) .style Display == = 'none') {arrProducts [i] .style.display = 'block'; } Other {arrProducts [i] .style.display = 'none'; }} And {arrProducts [i] .style.display = 'none'; }}} h5 {cursor: indicator; } .product IMG {height: 10px; Width: 10px; } & lt; H5 onclick = "showImage ('chair');" & Gt; Chair & lt; / H5> & Lt; H5 onclic = "show image ('table');" & Gt; Table & lt; / H5> & Lt; H5 onclic = "show image ('long_table');" & Gt; Meeting table & lt; / H5> & Lt; Div class = "product" id = "chair" & gt; & Lt; Img src = "picture / 1.jpg" height = "300px" /> & Lt; H4 & gt; Product 1 (Chair) & lt; / H4 & gt; & Lt; / Div & gt; & Lt; Div class = "product" id = "table" & gt; & Lt; Img src = "picture / 2.jpg" height = "300px" /> & Lt; H4 & gt; Product 2 (table) & lt; / H4 & gt; & Lt; / Div & gt; & Lt; Div class = "product" id = "tall_table" & gt; & Lt; Img src = "picture / 3.jpg" height = "300px" /> & Lt; H4 & gt; Product 3 (Meeting Table) & lt; / H4 & gt; & Lt; / Div & gt;
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Efficiently inserting a decimal in perl string -
मैं कोड भर आया: sub insertDecimal {my $ number = shift; मेरी $ sigDigRight = शिफ्ट; यदि ($ संख्या = ~ /। ./) {वापसी ($ संख्या); } एल्सफ़ (लंबाई $ संख्या & lt; $ sigDigRight) {वापसी ($ संख्या); } Else {my $ leftSide = substr ($ संख्या, 0, (लंबाई $ संख्या) - $ sigDigRight); मेरी $ rightSide = substr ($ संख्या, (लंबाई $ संख्या) - $ sigDigRight,); वापसी ($ बाएं साइड। "।" $ सही साइड); }} और मुझे इस रूप में सुधार / पुनः लिखने की उम्मीद थी: sub insertDecimal {my ($ number, $ sigDigRight) = @_; इंडेक्स ($ संख्या, '।') = $ 1 या लंबाई $ संख्या & lt; $ SigDigRight; # हाँ! उपस्ट्रैक्ट एक एलवीआरएड लेता है ... इसे अधिक के लिए प्रतिलिपि करें :) substr ($ संख्या, - $ sigDigRight, 0) = '।'; वापसी संख्या $; प्रश्न: प्रश्न: Li> डालने के बेहतर तरीके के साथ अतिप्रवाह किसी भी व्यक्ति को अधिक कुशल बनाने के लिए? कैसे मुझे कोई सुधार नहीं दिखाई दे, बिल्कुल (74 एमएम रिकॉर्ड पर सिर्फ एक मिनट बेहतर)? अगर पर्ल संकलक पहले संस्करण के कोड को अधिक कुशल बनाने के लिए पुन: जगी है, तो क्या मैं वैसे भी निष्पादन के लिए बेहतर पथ देख सकता हूँ जो कि पर्ल ने चुना है? दोनों रूटीन अनिवार्य रूप से एक समान काम करने लगेगा: स्कैन करें $ संख्या एक एकल वर्ण के लिए (कोई भी कंपाइलर उस रेगेक्स मैच को index से कम करने में सक्षम होना चाहिए) लंबाई की तुलना करें $ number से एक सीमा संभवतः $ number में कहीं भी एक अक्षर डालें > लावल्यू सबस्ट्रेट का उपयोग करना (या, सिर्फ substr के चौथे तर्क का लाभ लेना) सम्मिलन को थोड़ा और अधिक कुशल बना सकता है, लेकिन, आखिरकार, चीजों को स्थानांतरित करना होगा। मेरे लिए आंख, ऑप्टिमाइजेशन का सबसे बड़ा अवसर दशमलव बिंदु के लिए चेक के आगे की लंबाई की जांच को आगे ले जाने से आता है। मुझे आपकी रूटीन को फिर से लिखने का प्रलोभन होगा उप डालें दशमलव (मेरी $ $ संख्या, $ sigDigRight) = @_; लंबाई ($ संख्या) & lt; $ SigDigRight; यदि सूचकांक ($ संख्या, '।') & Gt; = 0; Substr ($ संख्या, - $ sigDigRight, 0, '।'); $ संख्या; } मुझे समझने में आसान होने के लिए सरल निर्णय और छोटी लाइन मिलती हैं I मुझे नहीं लगता कि यह फ़ंक्शन की शुद्धता को बदलना चाहिए। एक बदसूरत विकल्प है: उप gah {my ($ number, $ sigDigRight) = @_; मेरी $ n = लंबाई ($ संख्या) - $ sigDigRight; जब तक कि $ n & gt; 0; $ Number = ~ s {\ A ([^।] {$ N}) ([^।] +) \ Z} {$ 1. $ 2} x; $ संख्या; } यह । की प्रतिस्थापन प्रक्रिया के लिए जांच को जोड़ती है। दोबारा, मैं यह निश्चित नहीं कर सकता कि यह आपकी कल्पना सही है, लेकिन यह आपके लिए कुछ अन्वेषण करना है। मैं संभवत: gah के लिए विकल्प नहीं चुनता जब तक कि सुधार 20% से ज्यादा नहीं होता जो कम से कम एक घंटे या उससे अधिक समय तक लेता था। मेरे सिस्टम पर, यह 1,000% तक एक सरल उदाहरण को धीमा कर देती है।
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
c# - How to check if an XML attribute contains a string? -
Here's the XML (I've saved an HTML page to parse it normally in XML form: & lt; td width = "76" class = "DataB"> 2.276 & lt; / td> & lt; td width = "76" square = "databi" & gt; 2.289 & lt; / td & gt; & lt; td width = "76" class = "datab" & gt; 2.091 & lt; / td & gt; & lt; td width = "76" square = "database" & Gt; 1.952 & lt; / td & gt; & lt; td width = "76" class = "datab" & gt; 1.936 & lt; / td & gt; & lt; td width = "76" square = "current 2 "& gt; 1.899 & lt; / td> Now I am trying to find all the elements The string in which the string is turned on because the web page changes the number on the back: var xElements = xml.Descendants ("td"). Where (element => (string) element attribute (" Class ")) (" current ")); This returns an object error is not here: (string) element.Attribute ("class")) < / Code> How can I see a feature if there is something in it? If you asked me, it would be easy to write in the form of a xpath query. In this way you do not have to deal with cases where the element does not include class attributes and other such cases. var query = xml.XPathSelectElements ("// td [contains (@class, 'current')]"); Otherwise, you have to check the existence of the attribute before trying to read it. // Query syntax creates this small good type in Query = from xml.Descendants ("TD") classStr = (string) td.Attribute ("class") where classStr! = Null & amp; Amp; Select ClassStr.Contains ("Current") TD; // Or alternatively, xml.Descendants ("td") provides a default value var query = where td ("strings" td.Attribute ("class") "?" "") From td. In it selects ("current") td;
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
php - Using eloquent select related entries after restricting parent
entry in Laravel -
If I have a laurel class, then the category says, which has 1: relation with another class, Say suburban, how do I ask all subcategories with restrictions on the category category? For example, query all subcategories where the title in the class squares is "test". class category model {increases public function subcategories ({$ return-> $-> Hammaman ('app \ subcategory'); }} Increases class subcategory model {public function category ()) {return $ this-> Affiliation ('app' category '); }} I have tried: $ subcategories = Subcategory :: with (['category' => function ($ query) {$ Query-> where ('title', '=', 'test');}]) - & gt; get (); // gives empty space to all subcategories, where there is no zero = test I am interested in all the ways of doing this! edit - two solutions: $ data = category :: whereTitle ('test') - & gt; First () -> gt; Subcategories // or equivalently: $ data = category :: whereTitle ('test') - & gt; (Get) [0] - & gt; Subcategories; or create a dynamic scope by using an alpha solution within the subcategory public function scope range ($ query, $ type) {return $ Query-> Where (use 'range', function ($ q) ($ type) {$ q-> gtetitical ($ type);}); } // Then you can call segment from $ data = subcategory :: ('test') - & gt; get (); You can try to do something like this: $ Subcategories = Subcategory :: Where is ('range', function ($ query) {$ query-> where ('title', 'test');}) From ('Category') - & gt; ); This code will return the subcategories with the related category but only the related category.title Test . See also documentation about it.
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
javascript - Get HTML Code of Element (innerHTML + element tags) -
How to obtain the HTML code of the element in JavaScript with the existing element tag? For example Lt; / Body & gt; & Lt; Body & gt; & Lt; Div & gt; & Lt; Div class = "big" & gt; & Lt; P & gt; Some time ago & lt; / P & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Body & gt; Var x = document.getElementsByClassName ('bigger') [0] And now I want to get the HTML code of X: '& lt; Div class = "large" & gt; & Lt; P & gt; Sometext & lt; / P & gt; & Lt; / Div & gt; ' Not only: ' & lt; P & gt; Some time ago & lt; / P & gt; Like internal HTML Is this an easy way to do it? var div = document.createElement ("div"); Div.id = '_fooo'; Var parent = x.parentNode; Parent.insertBefore (div, x); Div.appendChild (x); Document.getElementById ('_fooo'). Internal HTML First of all, your HTML block is an error & lt; Input & gt; is an empty element, and can not have hair element in it, then Not a valid HTML. However, the answer to your question is 'external HTML' attribute. & lt; Div & gt; and type = "submit" class = "big" with input & gt; By changing tags, & gt; & Lt; P & gt; Sometext & lt; / P & gt; & Lt; / Div & gt; Var x = document.getElementsByClassName ('big') [0]; Var Output = X.uter HTML / Return '& lt; Div type = "submit" square = "big" & gt; & Lt; P & gt; Some time ago & lt; / P & gt; & Lt; / Div>
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
javascript - Canvas animating a pie chart -
I'm trying to revive the pie chart without using any plug-ins. May meet, but not quite. There is a difference between each segment because the incremental value is set to ++ Can someone recommend a clean solution to my problem? Here's my var canv2 = document.getElementById ("canvas2"); Var ctx2 = canv2.getContext ("2D"); Var r = 60, sAngle = 0, angle = 0, eengal = 0; Var interval2 = setInterval (function () {if (angle == 0) {ctx2.beginPath (); sAngle = 0;} and if (angle == 90) {ctx2.beginPath (); sAngle = Math.PI * 0.5 ;} And if (angle == 180) {ctx2.beginPath (); sangl = Math.PI;} and if (angle == 270) {ctx2.beginPath (); sangal = Math.PI * 1.5;} and if (Angle == 360) {ctx2.beginPath (); Sengel = Math.PI * 2;} and (if (angle> gt & amp; amp; amp; amp; amp; angle & lt; 90) {ctx2.arc ( 200, 80, R, S Engel, ENGL); ctx2.lineTo (200, 80); ctx2.fillStyle = "red"; ctx2.fill ();} and if (angle> 90 & amp; amp; amp; ; Angle & lt; 180) {Ctx2.arc (200, 80, R, Sainle, ENGL); Ctx2.lineTo (200, 80); Ctx2.fillStyle = "green"; ctx2.fill ();} and if ( Angle> 180 & amp; amp; & amp; Angle & Lt; 270) {ctx2.arc (200, 80, r, sngle, eAngle); ctx2.lineTo (200, 80); ctx2.fillStyle = "orange"; ctx2.fill ();} and if (angle & gt ; 270 & amp; amp; & amp; amp; & amp; amp; & amp; amp; Engangle & lt; 360) {ctx2.arc (200, 80, r, sngle, eAngle); ctx2.lineTo (200, 80); ctx2.fillStyle = "blue "; Ctx2.fill ();} other {clear interval (interval 2); }} Angle ++; EAngle = Angle * Monastery. PI / 180; }, 10) There is a demo you were really close to you. And must update your eagle. if (angle == 0) {ctx2.beginPath (); SAngle = -0.001; } And if (angle == 90) {ctx2.beginPath (); SAngle = Math.PI * 0.501; } And if (angle == 180) {ctx2.beginPath (); SAngle = Math PI-1011; } And if (angle == 270) {ctx2.beginPath (); SAngle = Math.PI * 1.501; } And if (angle == 360) {ctx2.beginPath (); SAngle = Math.PI * 1.999; } And (if (angle and gt; 0 and amp; amp; angle & lt; 90) {ctx2.arc (200, 80, r, sAngle, eAngle + .02); ctx2.lineTo (200, 80 ); Ctx2.fillStyle = "red"; ctx2.fill ();} and if (angle> 90 and & amp; angle> 180) {ctx2.arc (200, 80, r, sAngle, eAngle + .02); Ctx2.lineTo (200, 80); Ctx2.fillStyle = "green"; ctx2.fill ();} and if (angle> 180 & amp; amp; amp; & amp; engangle <270) {Ctx2.arc (200, 80, r, sAngle, eAngle + .02); Ctx2.lineTo (200, 80); ctx2.fillStyle = "orange"; ctx2.fill ();} and if (angle> 270 & amp; amp; amp; amp; amp; amp; angle & lt; 360) {ctx2.arc (200, 80, r, sAngle, eAngle + .02); CTX2.lineTo (200, 80); Ctx2 .fillStyle = "blue"; ctx2.fill ();} other {clear interval (interval 2);}} I think it's better to render It may be found working on it. Edit: Edit:
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
java - How to use CXF client in thread safe way -
I created the client stub for service below using the Apache-cxf 'wsdl2java command. Then I call the following as the getWeatherInformation () method. weather season service = new weather (); WeatherSoap weatherSoap = weatherService.getWeatherSoap (); ArrayOfWeatherDescription Results = WeatherOapGetWeeration (); I've read that the CXF client threads are safe. But I doubt whether it is safe to use the same WeatherSoap on multiple codes? Or can I use an example of the Weather class in many threads? Thank you. Edit: What I do I have exposed a Restrict API to the public and if someone says that I call any other SOAP service the rest of the service. The above code is used to call the SOAP service. What do I want to know, should I execute all the above lines for every remaining request, or do I reuse an example for the fulfillment of all REST requests of or WeatherSoap I can do Pure Java Public class MySoapClient {Personal Static WeatherSoap weatherSoap; Private MySopClient () {} Public stable weather scope getClient () {if (WeatherSoap == null) {weather weather service = new weather (); WeatherSop = Weather Service Gatewayther soap (); } Weather return SOAP; }} And I will modify the weather category to get the SOAP url from the property file. @WebServiceClient (name = "weather", wsdlLocation = "classpath: weather.wsdl", targetNamespace = "http://ws.cdyne.com/WeatherWS/") public class weather Extension of service {private stationary logger log = logger factory.getLogger (Weather.class); Public Last Fixed URL WSDL_LOCATION; Public Last Fixed QName SERVICE = New QN ("http://ws.cdyne.com/WeatherWS/", "Weather"); Public Last Fixed QName WeatherHttpPost = New QName ("http://ws.cdyne.com/WeatherWS/", "WeatherHttpPost"); Public Last Fixed QName WeatherHttpGet = New QName ("http://ws.cdyne.com/WeatherWS/", "WeatherHttpGet"); Public Last Fixed QName WeatherSoap12 = New QN ("http://ws.cdyne.com/WeatherWS/", "WeatherSoap12"); Public Last Fixed QName WeatherSoap = New QN ("http://ws.cdyne.com/WeatherWS/", "WeatherSpace"); Static {url = null; {Url = New URL (see MyPropertiesUtil.getProperty ("app.weather.url"); } Catch (MalmarmdoorLecepation E) {LOG.error (e.getMessage (), e); } If (url == faucet) {LOG.error ("an issue with your url"); } WSDL_LOCATION = url; } Public Weather (URL wsdl Location) {Super (WSDL Location, Service); } Public Weather (URL wsdl location, QN service service) {super (WSDL location, savannum); } Public Weather () {Super (WSDL_LOCATION, SERVICE); } // All other interface methods} Use of Spring If you are using spring then you can also simplify things You can create, eliminate the class by using the configuration file to end the Weather.java and cxf generates the proxy for you. & lt; Jaxws: client id = "weatherSoap" serviceclass = "com.cdyne.ws.weatherws. WeatherSoap" address = "$ {app.weather.url}" /> and the business class will look down. @Component MyBusinessLogic {@Autowired Private WeatherSoap weatherSoap; Public ArrayOfWeatherDescription getOutput () {Return weather SWoap.getWeatherInformation (); }}
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
mysql - Query cannot be parsed, please check the syntax of your query.
(ORA-00905: missing keyword) -
is trying to create an interactive report with the SQL query below. The error mentioned in the title is Choose FIRST_NAME || '' || Where "user name" from users (where user name temp_amal from user ACCESS_DATE & gt accessed_by selection select USERNAME; = P2610_DATE_FROM and ACCESS_DATE & lt; = P2610_DATE_TO and (case: P2610_RADIO) 'Then Col1 =' F 'end))) sequence by 1; after where both operands of the condition do not Enter in a case . Just either one of them. Select FIRST_NAME || '' || Where the user name is not (user name temp_amal where users select from ACCESS_DATE & gt accessed_by select USERNAME;): "P2610_RADIO: P2610_DATE_TO and col1 = (case = P2610_DATE_FROM and ACCESS_DATE" where users with "LAST_NAME" F 'then' F 'end))) sequence by 1; So, you want to make your question more dynamic. You have to do dynamic SQL query generation.
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
delphi - Make $DEFINE permanent across several modules -
I have a number of projects that use some common code. It is conditionally defined in the project settings and I want to be able to define some of the symbols that continue in many modules. For example: {$ if defined is defined (PROJ1_DEBUG) or defined (PROJ1_NDEBUG)} {$ Definition PROJ1} // Project 1 {$ elseif is defined ( PROJ2_DEBUG) or defined (PROJ2_NDEBUG)} {$ Definition PROJ2} // Project 2 {$ elseif is defined (else, PROJ3_DEBUG) or defined (PROJ3_NDEBUG)} {$ PROJ3 Definition} // Project 3 {$ IFEND} That's why the main project file can appear on top, now I have projects In many units, you want to be able to use the following conditional compilation: {$ ifdef PROJ1} Do some specific work // $ {$ endif} for project {$ ifdef PROJ2} Do not do specific / project 2 {$ endif} but I try to find that "PROJ1" and "PROJ2" (and "PROJ3" are obviously not defined) when I try And their use Embarcadero (help) shows my symbols will only be defined for the current module But they will not provide any help to define across multiple modules. I can define it that it is possible to define more permanent symbols once and then use them across multiple modules? You have two options: conditionally defined at the project level Please. From the project options dialog. Define the conditional inclusion of an included file that you need to test every unit conditional.
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
java - How do I get the result code from SQLException or
PreparedStatement with SQLite -
I am creating a REST API and working on returning the correct status code to the customer. I have a SQLite database and have created a table like this: create table view (id integer primary key autoincreent, name varchar (10) is not unique, data varchar (10) not Faucet) The connection to the database works fine. I can also add a visual unit to the table. When I run prepstmnt.execute () to present another view as a scene before same , I get a SQLException as expected (since the name is unique). Because this method can throw SQLException for a variety of reasons, so I want to know when the reason is a violation of the barrier, so I can return the HTTP status code. 409 Clash I struggled for it Trying to do it by arrackcode () and getMessage (): hold (SQLException e) {System.out.println (e.getErrorCode () + ":" + e.getMessage () ); 0: [SQLITE_CONSTRAINT] Revoke due to constraint violation (column name is not unique) As you can see that I get the error code 0. SQLite documentation according to the result code 0 mean ok is. Instead, I should get code 1 for SQLITE_CONSTRAINT. The message sounds fine, but I did not want to parse the message. In the SQLite error code, there is a subset of the result code, does it take the JDBC account or the error code is completely different? How do I get the result code from SQLException or a prepared statement?
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Undo layout in R -
Let me initially create a plot that is in the boxplot & amp; Histogram I set this for nf < - Layout (mat = matrix (c (1,2), 2,1, byrow = TRUE), height = c (1,3)) equals (march = c (2,2,1,1)) # draw box Plot # Digest Histogram After that I need to make a regular plot. But I think that later all the plots try to follow the same layout. I should use NF & LT - Layout (matte = matrix (c1) Yes, use: equals (mfrow = c (1,1)) get other good answers < / P>
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
nsstring - Objective C should these two return the same value -
नीचे दिए गए कोड में notificationIdToCancle1 और सूचना IdToCancle2 के अंतर क्या है : NSDictionary * पैरामीटर = (NSDictionary *) पैरामीटरओब्जेक्ट; अगर (पैरामीटर! = शून्य) {NSString * notificationIdToCancle1 = (NSString *) [पैरामीटर objectForKey: @ "id"]; NSString * अधिसूचनाIdToCancle2 = [NSString stringWithFormat: @ "% @", [पैरामीटर मान ForKey: @ "id"]]; } दोनों में एक ही मान नहीं होना चाहिए? NSString * notificationIdToCancle1 = (NSString *) [पैरामीटर objectForKey: @ "id"]; यह पंक्ति ऑब्जेक्ट को डिक्शनरी में हथियाने है, उसे एक NSString में कास्ट कर रहा है चाहे वह है या नहीं। [NSString * stringWithFormat: @ "% @", [पैरामीटर मान फोरेकी: @ "आईडी"]]; यह रेखा, मुझे लगता है कि आपको एक गलती है, शायद आप पहले '*' नहीं चाहते हैं आप शायद 'valueForKey:' के बजाय 'valueForKey' कॉल करना चाहते हैं: '। ObjectForKey: शब्दकोश में प्रविष्टि वापस आ जाएगी, जबकि valueForKey: मान वापस करने के लिए कुंजी मान कोडिंग का उपयोग करेगा। [NSString stringWithFormat: @ "% @ ", [पैरामीटर objectForKey: @" id "]]; यह शब्दकोश में ऑब्जेक्ट लेता है, उस पर 'वर्णन' चलाता है जो एक NSString आवृत्ति देता है। इसलिए आप निश्चित रूप से इसके बाहर एक NSString उदाहरण प्राप्त कर सकते हैं।
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
haskell - GHC cannot find dynamic libraries - Could not find module
‘Data.Functor.Reverse’ -
GHCI-7.8.4 transformer will not load anything from the library because it did not find the GHCi file is . What is wrong? Prelude & gt; Import data. Factor Reverse & lieutenant; No location info & gt;: module 'data could not be found. Factor Again 'Maybe you have not installed the "dyn" libraries for the package' Transformers -0.4.3.0 '? Use -v to see the list of used files. Search for location: /home/jdm/.cabal/lib/transformers-0.4.3.0/ghc-7.8.4/Data/Functor/Reverse.dyn_hi Use the - enabled-shared option to install the cables. If you want a dynamic library everywhere, keep shared: true in ~ / .cabal / config . You will need to compile all your libraries again.
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
linux - Can I/How do I force micro-SD card to r/w mount? -
I have a sandisk 64 GB MicroSD card that I'm using in my phone. I refuse to refuse to save and I am currently trying to figure out that it is possible to fix the problem. I have an SD card slot on the Kubantu laptop and SD card, the adapter I am using to plug in and trying to mount the Micro SD. Although the problem continues, I can mount the card as readable without problems and I can use everything on it (which I have copied now) and everything is not well. As soon as I try to mount with the use of writing, I have problems. Using the following command, sudo mount -o rw, umask = 000 / dev / mmcblk0p1 / media / exfat / I get this output: 'WARNING: The volume was not properly mounted Error: fsync failed. 'And it does not mount. If I use sudo mount -o ro, umask = 000 / dev / mmcblk0p1 / media / exfat / I still get this error 'Warning: the volume was not properly unmounted.' But it is a mount and I have full access. Does anyone know whether it is undoubtedly or should I leave now and get a new one? Any assistance will be received with gratitude. I had such a situation, but after doing all kinds of things in many minutes of frustration, I There is a small 'read-only' switch on the SD card adapter there.
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
data visualization - Plot all columns in a file using gnuplot without
specifying number of columns -
I have a large number of data that I want to plot using gnuplot. In the files text column, as many columns I wanted to use Gnulplot to plot all the columns in any file, without identifying the number of columns to be plotted or the number of total columns in the file Without identifying, since the total number of columns varies, the files I have to have are such a way that I can use it gnuplot? You can go about it differently, some more and some less elegant. Make the following file as data as an example: 1 2 3 2 5 5 5 3 1 3 4 5 2 5 5 5 6 4 2 There are 3 columns in it, but you want to write a normal script without any particular number of assumptions. The way I had to go about this, send it to awk to get the number of columns in your file in the gnuplot script by system () call: Have to use. [I = 1: N] "data" u 0: iwl title "column" .i N = system ("awk 'NR == 1 {print NF}' 'data) Say you ' T wants to use the system () and know that the number of columns will always be less than a certain maximum, for example 10: for the plot [I = 1:10] "data" u 0: iwl title "column" .i Then the Gnulplet will complain about the non-existent data but still the column 1 to 3 will be the same.
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
ios - How can you make a UITextfield give suggestions and return your
selection using Swift? -
The application I created needs to use the search bar for comb through the array and what you write There are suggestions for this. When the suggestion appears from the array, then you need to select it and return it to UITextField . I have done so many research in how I have done this, but no luck has happened so far, I have found some things in Objective-C but still does not help me. I know that this is a little bit on the internet to do with a UISearchController , however, UISearchController do not give me what I need, I need the initial search field Not in the UITableViewCell , not at the top of the page, if it comes It will work if you can change the initial search field, but I have done research that is not possible. If this is possible, can you please tell me that after all this is what I wanted. So my code is so far UITableview with two sections, the first of which is the textfield as I suggest appearing as typing I want to use the second section. I am having difficulty in inserting new lines and displaying suggestions based on my array, not only by me but also with many of our course partners, any help would be greatly appreciated because of their final graduate projects Along with the same problems. Here is my code Import UIKit class ViewController: UITableViewController {var stations: [string] var section title: [string] @ IBOutlet weak Var searchField: UITextField! (In the "London") stations .append ("Poole") section title = [string] () sectionTitle (init) (stations: [bn] .append ("search") sectiontelt.apend ("result") super intrate (encode: adcoder)} overdried funk viewDidload () {tableView.rowHeight = 80; SearchField.delegate = self super.viewDidLoad () // Make an additional setup after loading the view, usually from a nibb. } Override Funk Receive Memory Warning () {super.didReceiveMemoryWarning () / any resources that can be redone. }} Extension View Controller: UITableViewDataSource {override func numberOfSectionsInTableView (Table View: UITableView) - & gt; Int {return sectionTitle.count}} Extensions View Controller: UitViewDelegate {override func tableView} (table view: UITableView, didSelectRowAtIndexPath index path: NSIndexPath) {tableView.deselectRowAtIndexPath (indexPath, animated: true)} Override func tableView (tableView: UITableView, titleForHeaderInSection section : Int) - & gt; String? {Return section title [section]}} Extension View Controller: UITDefined Delegate {Funka Textfield Shawled Retrain (Textfield: UITFixified) - & gt; BULL {println ("search") // Loop though the stations array // path = NSIndexPath (forRow: 1, address: 1) // path = = [path] // tableView.insertRowsAtIndexPaths (path, with three-dimensional animation: automatic. ) Cell = tableView.cellForRowAtIndexPath (NSIndexPath (forRow: 0, in Address: 1)) Cells? .textLabel? .text = searchField.text searchField.resignFirstResponder () returns true}} I 've been given great attention to the fact that my code needs to be focused, because now I would be happy if I could insert rows in the second part for each part of my part, i.e. loop through the array and insert the new line for each item. View Detail Controller: UITableViewDelegate {Override Function Table View (Table View: UITableView, didSelectRowAtIndexPath Index Path Path: NSIndexPath) {tableView.deselectRowAtIndexPath (indexPath, Animated: True)} Override Func tableView (Table View: UITableView , TitleForHeaderInSecti section: int) - & gt; String? {Return section title [section]}} Extension View Controller: UITDefined Delegate {Funka Textfield Shawled Retrain (Textfield: UITFixified) - & gt; BULL {println ("search") // Loop though the stations array // path = NSIndexPath (forRow: 1, address: 1) // path = = [path] // tableView.insertRowsAtIndexPaths (path, with three-dimensional animation: automatic. ) Cell = tableView.cellForRowAtIndexPath (NSIndexPath (forRow: 0, in particular: 1)) cell? .textLabel? .text = searchField.text searchField.resignFirstResponder () returns true}}
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
excel - How do I keep VBA from putting output into the active sheet? -
I am working with a group of CSV files which have been dragged into a workbook. In the end, I put the data together in a single array and then in one sheet. Whenever I run sub, however, it loads the data in the active sheet As the slow start_cell_range range set, How do I show data in a single sheet, how can I show data in a single sheet? ("data_history")) has been started in the form of DMN N for integer ("data_history") with workspaces ("data_history") from n = 0 to 18 initial_gate_orig.phase (n, 1) = Last_array (n) Next n end The problem is that before you get the sheet, Determining: initial_grade_referenceRange = set (find_last_column ("Data_History")) This is using active sheet, as the car Integer with Yptrkon ( "data_Y history") offers to move the sheet that you want just the line that defines the border after the shell you define. Remember to use and with with instead of range block (it's like calling worksheets ("Data_History" ). Range (...) Here is the full code: Range as the start_cell_range range with dim n verticals ("data_history Set the set_cell_range =. ("Data_history") set for n = 0 to 18, initial_gate_orange.offetset (n, 1) = next_ and next with end_array (n) < / Div>
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
python - Strange NameError: name 'math' is not defined, while "import
math" -
I get the NameError when executing this code. It's weird because the import math in code is the import math in sigma module ... maybe it's a kind of conflict? Thanks for your time! file: c: \ user \ greenmen \ document \ python script \ sigma_crit.py ", line 21, sigma_crit # Simplified MC in NameError: name is not 'math' defined Import Sigma as SGM # module as "import math" in sigma as well as import math diff sigma_eded (sigmax, sigma, sigmaz, theta, pw, pry, NUU, alpha, NO): "" "Important stress calculation for one of the three failure criteria Return value No. 1 - Simplified seal-coilbo 2 - Sealer-Qulbo 3 - List with the Drucker-Prag 4-3 model, SigmaX - Strain X Wellbor axis in Sigmaii - Y Wellbor Axis Strain - Thatta - Ezimath, SHMX Antiglow - POSON ratio alpha-biot coefficient from NUI "" "sigma_tethheka = sgm.sigma_calc (sigmax, sigmai, sigmaz, theta, pw, pre, new, alpha, 1) sigma_zi = sgm.sigma_calc (sigmaax, sigma, sig Mass, Theta, PW, Press, New, Alpha, 2) Sigma_Stie = sgm.sigma_calc (sigmaax, sigma, sigmaz, thita, pw, press, new, alpha, 3) # degrees for radians for the equations below. Built on carefully above the function, converter theta = mathematics. Rebels # Simplified MC You stale bytecode You have changed the source file but have not restarted Python. You can see it from traceback; But your traceback shows the comment on next . Em> line; The bytecode reference is clearly old and you have changed the code.
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
php - Page hits counter - Am I overexerting the database? -
I have built a simple hit counter on my website. (PHP & MySQL, using CodeIgniter as my framework) I use this table: table page_hits (id INT not NULL AUTO_INCREMENT , PAGE_URL VARCHAR (350) No NULL, IP VARCHAR (11) No NULL, INT not hit tap, `date` TIMESTAMP default CURRENT_TIMESTAMP tap, primary key (ID)); On each page load, I check whether the page_url & amp; If there is a ip in the table, then I increase the value of 1 to hit 1. If not, then I will create a new line in the table. Timestamp is not to so as to does not hit much to refresh the page count as a new hit, allowing a certain delay between. All this works well, but I am afraid that I can be overloaded in my database. .. In less than 24 hours, I have more than 6,500 lines in page_hits table So my question is:. What are the risks of having such a fast growing table in my database? (? Duration of the database size exceeding performance issues?) write me a line of SQL command again Do not start: Default CURRENT_TIMESTAMP No NULL, Primary Key (ID)) Now I can see what's there Your table is not complicated, but it's quick Areas will it will not be a problem, as long as you do not do anything with it. In other words: add rows in the table is no problem, even though as soon as you have one million rows While you start query the table, you think it will be very slow You have forgotten to add index. Secondly, you can think of getting rid of your table and getting rid of unnecessary information. For example, these three small tables: table page_hits (id INT no NULL AUTO_INCREMENT, page_id INT not NULL, client_id INT not NULL, INT no NULL kills, Primary key (ID) ) do not create tables pages (id INT NULL AUTO_INCREMENT, PAGE_URL VARCHAR (350) NULL, pRIMARY KEY (id)) table NULL not customers (id INT AUTO_INCREMENT, IP Create VARCHAR (11) nOT NULL, on TIMESTAMP NULL default CURRENT_TIMESTAMP, Primary key (id)) indicates page_id here page Ndrbhit does table, and client_id > customer table, you must add indexes to myself to get rid of the date column, and a cookie With this problem will be resolved. Note that the new table can include more information without getting too large too quickly to be expanded.
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
regex - Correct wrongly formatted dates -
I have some formatted dates that are between a good formatted date, something looks like this: df & lt; - data.frame (col = c ("- 1.1.11-01", "- 1.11.12-1", "- 1.1.13-01", "- 1.1.14-01" "- 1.10.10- 01 "," - 1.10.11-01 "" --- 1.10.12-01 "," 2010-03-31 "," 2010-04-01 "," 2010-04-05 ")) How can I convert the wrong format between the current formatted date? I am able to delete the first dash, but for this, the last 3 characters of -01 or -1 have to be removed. So the correct values are: desired < - c ("1.1.11", "1.1.12", "1.1.13", "1.1.14", "1.10" 10 "," 1.10.11 "," 1.10.12 "," 2010-03- 31 "," 2010-04-01 "," 2010-04-05 ")) What I'm doing is messing with part of -01 Because, by removing them, it will also remove a part of the correct formatted dates. Edit: Format mm.dd.yy A simple regexp will solve these types of problems very well: & gt; Df & lt ; - c ("- 1.1.11-01", "- 1.11.12-1", "- 1.1.13-01", "- 1.1.14-01", "- 1.10 0.10-01", "- 1.10.11-01 "" --- 1.10.12-01 "," 2010-03-31 "," 2010-04-01 "," 2010-04-05 ") & g T; df [1] "- -1.1.11-01" "- -1.11.12-1" "-1.1.13-01" "-1.1.14-01" "-1.10.10-01" " -1.10.11-01 "" --- 1.10.12-01 "[8]" 2010-03-31 "" 2010-04-01 "" 2010-04-05 "& gt; Df & lt; - sub (". * ([0-9] {4} \\ - [0- 9] {2} \\ - [0- 9] {2} | [0- 9] {1,2} \\. [ 0- 9] {1,2} \. [0- 9] {1,2}). * "," \\ 1 ", df)> DF [1]" 1.1.11 "" 1.11 12 "" 1.1.13 "" 1.1.14 "" 1.10.10 "" 1.10.11 "" 1.10.12 "" 2010-03-31 "" 2010-04 -01 "[10]" 2010-04-05 " Note that I have made it a character vector instead of data.frame. The solution is to match the pattern or the other pattern, and then replace the rest with the subparents.
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
What's a good way of adding and remove object details to an array when
a checkbox is checked or unchecked using AngularJS? -
I have an API that takes objects {'title': 'some' , 'Character': 'object', 'environment': '[{id': 1}, {'id': 2}]} I have to add new entries There is a form of setting a description for the title and object that I am going to pass my API: & lt; Form class = "form horizontal" role = ng-submit = "vm.submitForm ()" & gt; & Lt; Label = "title" & gt; Title & lt; / Label & gt; & Lt; Input class = "form-control" id = "title" type = "text" ng-model = "vm.myObj.title" placeholder = "title" /> & Lt; Label = "desc" & gt; Details & lt; / Label & gt; & Lt; Input class = "form-control" id = "disc" type = "text" ng-model = "vm.myObj.desc" placeholder = "description" /> & Lt; Div class = "checkbox" ng-repat = "env in vm.availableEnvs" & gt; & Lt; Label & gt; & Lt; Input type = "checkbox" /> {{Env.label}} & lt; / Labels & gt; & Lt; / Div & gt; & Lt; Hour / & gt; & Lt; Button & gt; Submit & lt; / Button & gt; & Lt; / Form & gt; In the form you probably noticed that I have a ng-repeat which repeats on an array of environmental objects: (id: 2, label: "EU"}, {id: 3, label: "ASIA"}, {id: 4, label: "Africa"}]; Since there is a need to get an array of APIs: {id: x} objects, I was thinking that there is a good way to add (and delete) anyone My .js code: (function () (onservices), Microsoft. $ Injection = ['Envisivea']; fiction microlton (envisioner) {var vm = this; vm.availableEnvs = EnvService.getAvailableEnvvironments (); vm.myObj = {title: '', desc: '', environment: []}; vm. SubmitForm = submitForm; Function Submit Form () {// Make a service call that handles $ http and creates a POST with my obj)} function anvas () {this.environments = [ID: 1, label: {ID: 2, label: "EU"}, {ID: 3, label: "Asia"}, {ID: 4, label: "Africa"}]; This.getAvailableEnvironment = function () { Return.environments; }}}} (); What I do in such cases is as follows: Setting subscriptions, i.e. intermediate array [i] is true if is included in main [i] , an intermediate Create an array of postal data, $ watchCollection on intermediate array and set target target accordingly. FOKE BELD: (I have also changed the service to return promise - I believe this is a best practice, but this Not mandatory for answers.)
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Canvas custom shape fill issue -
I need to create custom shapes in the canvas to show the graph in human shape. I made the shape, but when I I try to fill it, it is not being filled properly, some part is missing and some overflow is there. This is a link to my demo: var canvas = document.getElementById ('myCanvas'); Var reference = canvas.getContext ('2d'); Context.beginPath (); Context.arc (65, 60, 35,0, Math. PI * 2, true); Context.moveTo (5,100); Context.lineTo (5, 300); Context.moveTo (35,300); Context.arc (20, 300, 15, 0, Math. PI); Context.moveTo (35,300); Context.lineTo (35, 250); Context.lineTo (95, 250); Context.lineTo (95, 300); Context.moveTo (125,300); Context.arc (110, 300, 15, 0, Math. PI); Context.moveTo (125,300); Context.lineTo (125100); Context.lineTo (5, 100); Context.fill (); When you're drawing cirles you're getting in trouble. You are in (5, 300), then you go (35,300) and now you draw your circle back (5, 100), then go back (35, 300). Instead, you can clock the clock by adding the parameter true at the end of the acr () - function: Before: Context.arc (110, 300, 15, 0, Math. PI); After : context.arc (110, 300, 15, math.pi, 0, true); As you can see, I have also reversed the radius values
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Magnific popup - undefined is not a function when parsing markup -
So I'm using a magnetic popup and whenever I use my own inline template and complete markup Parsing, line is failing 231. Here is my code: This is my html: & Lt; / A & gt; & Lt; / Div & gt; & Lt; Div square = "piece" & gt; & Lt; A rel = "gallery" title = "girl kissing father" href = "/ themes / images / grid / image2.png" data-description = "" & gt; & Lt; P class = "caption" & gt; Girl kissing father & lt; / P & gt; & Lt; Img src = "/ themes / images / grid / image2.png" alt = "picture" /> & Lt; / A & gt; & Lt; / Div & gt; & Lt; / Div & gt; This is my JavaScript: var data = []; $ ('Gallery One') Each (function (e) {var item = {title} $ (this) .attr ('title'), href_img: $ (this) .attr ('href'), description: $ (this) .attr ('data -details')}; Datasheet (item);}); $ ("Gallery"). MagnificPopup ({Representative: 'A', Type: 'Image', Item: Data, Type: 'Inline', Close ContentClick: True, Inline: {// Defined Markup. Name Mark Mark: '& lt; div class = White-popup "& gt; div class =" mfp-close "> & # 39; + & # 39; span class =" mfp-title "& gt; & lt; / lt; / Div & gt; '+' & lt; div class = "mfp-href" & gt; & lt; / div & gt; '+' & lt; div class = "mfp-description" & gt; & lt; / Div> '+' & lt; / div & gt; '}, gallery: {enabled: true}}); The failed line 231 has a great popup that is in the _parseMarkup function. How this function looks: _parseMarkup: function (B, C, D) {var e; D.data and amp; Amp; (C = a.extend (d.data, c)), y (f, [b, c, d]), a.each (c, function (a, c) {if (c === undefined || C ===! 1) Return! 0; e = a.split ("_"); if (e.length & gt; 1) {var d = b.find (j + "-" + E [0] ); If (d.length & gt; 0) {var f = e [1]; f === "with replacement"? D [0]! == C [0] and D. location (c) ): F. === "img"? D.is ("img")? D.attr ("src", c): D. location ('' '): d.attr (e [1], c)}} and b.find (j + "-" + a) .html ( C)})}, code: e = a.split ("_"); is unsuccessful .. It is saying that there is no undefined function. I did a console.log (a) and before that error has been thrown, 0 has been returned .. I do not know where he got from 0, though not sure .. When I do a console (.log) on my data variable, this is what is being pulled: object, purpose] 0: Object details: "" href_img: "http : //rayndee.localhost/themes/light-fixed-width/images/grid/image2.png "Title:" Girl Kiss Father "__Pooto__: Object 1: Object Description:" This is a description of "href_img:" http: / /rayndee.localhost/ Theme / light-fixed-width / images / grid / image 1 page "Title:" Girl Holding Flowers "__Pooto__: Object Length: 2__Pooto__: Array [0] Any help Thank you !
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
php - Graphical mode in phpseclib -
आलेखीय मोड का उपयोग कैसे करें -X में phpseclib मैन्युअल विधि (टर्मिनल) है: $ xhost + Ipserver // एक्सहोस्ट +192.168.1.6 & lt; br / & gt; $ Ssh -X nomtilisateur @ एपसेरवेर // एसएसएच -एक्स जैक @ 192.168.1.6< br / & gt; $ निर्यात DISPLAY =: 10.0 & lt; br / & gt; $ Xeyes & lt; br / & gt; मुझे स्क्रिप्ट PHP में ग्राफ़िकल मोड का उपयोग करने की आवश्यकता है & lt;? Php & lt; br / & gt; & Lt; br / & gt ( 'नेट / SSH2.php') शामिल हैं; $ Ssh = नया Net_SSH2 ('192.168.1.6'); & lt; br / & gt; अगर (! $ Ssh- & gt; लॉगिन ('जैक', '******')) {& lt; br / & gt; बाहर निकलें ('लॉग इन असफल'); & lt; br / & gt; } & Lt; br / & gt; // गूंज $ ssh- & gt; exec ('एक्सहोस्ट +192.168.1.3'); & lt; br / & gt; // प्रतिध्वनि $ ssh- & gt; exec ('ssh -X'); & lt; br / & gt; // प्रतिध्वनि $ ssh- & gt; exec ('निर्यात DISPLAY =: 10.0'); & lt; br / & gt; एंको $ ssh- & gt; exec ('xeyes'); & lt; br / & gt; ? & Gt; & lt; br / & gt;
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Cakephp 3.0 login as Anonymous -
I write the system using Cakephp 3.0 and I have to log in as a registration user and login ad anonymous user should be there. Login and password are logged in as a registered user. But how to log in as anonymity? I should add a unique name like this: Should user 2512 for anonymous user and dismiss it in a cookie or cache?
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
javascript - List all the extensions installed in google chrome -
I have used all the functions of Chrome: Admin.Gate to list all the extensions installed on my google chrome browser. However, this function only returns the extensions I have installed from Chrome Web Store and what I load (which I have made). I am using this function with the intention of establishing communication with another function. chrome.management.getAll (function (extInfos) {extInfos.forEach (function (ext) {console log (ext.name);})}}; You just do not need id for message extension Is passing between? check: . It can be easily retrieved from the ID extension list (just copy / paste) and it will remain the same even when you publish your extension.
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Magento Add fee on grand-total depending about payment gateway user
selcted -
I need to add additional charges and the total fee charge gateway depends on the user if the user's payment method is of 1 fee The selection is $ 3 and so on .... I'm able to add fees to the Grand Total with the help of "sales_quote_collect_totals_after" supervisor. Now I need to get the current payment gateway, so I will charge that user. Thanks in advance
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Creating String Array joining elements of 2 arrays in php -
ये मेरे इनपुट हैं: $ firstname = array ("राज", "स्वाती "" कुणाल "" हेमा "," करीना "," दीपिका "," शिल्पा "," अमिताभ "," शाहरुख "," कंगना "); $ अंतिम नाम = अरै ("कुमार", "शर्मा", "कपूर", "मालिनी", "कपूर", "पादुकोण", "शेट्टी", "अमिताभ", "शाहरुख", "कंगना"); मुझे एक सरणी बनाने की आवश्यकता है जो $ पहले नाम [i] को $ अंतिम नाम [$ i} के साथ जोड़ देगा और इस तरह से एक ऐसा ऐरे बनायेगा जो पहले नाम और अंतिम नाम को जोड़ता है। मेरा आउटपुट नीचे है लेकिन यह सही नहीं है: & lt;? Php foreach ($ firstname $ पहले) {foreach ($ lastname $ last) {$ fullname [] = $ पहले। ""। $ Last; }} Print_r ($ पूर्णनाम); ? & Gt; मुझे संभवतया एक अग्रविकल्प पाश का इस्तेमाल नहीं करना चाहिए, लेकिन मैं फंस गया हूं। $ firstname = array ("राज", "स्वाती", "कुणाल", "हेमा", "करीना", "दीपिका", "शिल्पा", "अमिताभ", "शाहरुख", "कंगना"); $ उपनाम = सरणी ( "कुमार" "शर्मा", "कपूर", "मालिनी", "कपूर", "पादुकोण" "शेट्टी", "अमिताभ", "शाहरुख", "कंगना"); $ आकार = गणना ($ पहलेनाम); ($ I = 0; $ i & lt; $ size; $ i ++) {$ fullname [] = $ प्रथम नाम [$ i] के लिए। "" $ अंतिम नाम [$ i]; }
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
php - short links without htaccess how? -
My friend, I am noob in htaccess and I need your help :) My Httac File: Option + Rewrite in follow up script Wrong Raul Pro /(.*)/(.*)$ index.php? Site = $ 1 and cat = $ 2 again /(.*)/ (. *) $ Index.php? Site = $ 1 and amp; Cat = $ 2 rewrite rule / (.) /(.*) $ index.php? Buy site = $ 1 and cat = $ 2 rewrite /(.*)/ (. *) $ Index.php? Site = $ 1 & amp; Cat = $ 2 RewriteRule payment indices.Site? Site = pay rewrite distribution index.php? Site = Delivery RewriteRule faq index.php? Site = faq rewrite contact index.php? Site = replace rewriterule index.php? Site = Change My current product links are: http: // localhost / pro / id / keys Http: // localhost / pro / id / Voucher http: // localhost / pro / id / tools Is it possible to make my link ?: http: // localhost / keys .exe http: //localhost/voucher.exe http: //localhost/tools.exe or at the end of .exe? Try for my bad english: SI hopes that any of you can help me with my problem: ( A user told me to: Change this rule: Reerrmet Raoul Pro /(.*)/(.*)$ index.php? Site = $ 1 & amp; Cat = $ 2, with Rivet Condom% {REQUEST_FILENAME}! -f Rewrite Rule ^ ([^.] / html>
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
.net - ItemsControl fill order -
.net - ItemsControl fill order - i trying fill itemscontrol 7 items, requested order this 1 2 3 4 5 6 7 actually, order of 2 first line doesn't matter, don't mind have: 2 1 3 5 4 6 7 this code project <itemscontrol x:name="productslist" itemssource="{binding path=products}" > <itemscontrol.itemspanel> <itemspaneltemplate> <uniformgrid columns="3" background="white" /> </itemspaneltemplate> </itemscontrol.itemspanel> </itemscontrol> when used uniformgrid got 1 2 3 4 5 6 7 i tried wrappanel had 2 problems first order was: 1 2 3 4 5 6 7 second: wrap panel did not fill command contains wrappanel stands on top left corner any ideas? thanks .net wpf itemscontrol
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
jquery - Wordpress collapsing menu keeps not expanded -
jquery - Wordpress collapsing menu keeps not expanded - currently i'm working on site: goo.gl/nud31r the problem submenu keeps not expanded after clicking on links. this code is, of course, placed in header.php <script> $(document).ready(function(){ $('.menu .dropdown a').click(function(e){ if ($(this).parent().children('.sub-menu').is(':visible')) { $(this).parent().children('.sub-menu').toggle(); } else { $(this).parent().children('.sub-menu').toggle(); } }); }); </script> i guess it's little thing , appreciate help! thanks! if want sub menu expand after clicking , after page changes need toggle on doc.ready instead of on click. $(document).ready(function() { $("li.current-menu-item").closest(".sub-menu").toggle(); }); jquery wordpress menu
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
python - Print won't work in if statement -
python - Print won't work in if statement - when run script, skips print function in line 8. cannot figure out why life of me. have tried many things working can't seem figure out problem here. new python excuse me if it's simple issue. edit: woops, forgot actual code! facepalm here is: import webbrowser import sys b = webbrowser.get('windows-default') print('type start') line1 = sys.stdin.readline() start = 'start' if line1 == start: print('what website want open?') line2 = sys.stdin.readline() b.open(line2) when type 'start' stdin , nail enter, entire string including newline character ends beingness stored in line1. in reality, line1 == 'start\n'. need remove \n end of string before comparison. easy way using str.rstrip: if line1.rstrip() == start: print('what website want open?') edit: as ashwini chaudhary pointed out in comments, should using raw_input (or input if using python 3.x) instead of sys.stdin.readline. create code shorter, , remove need strip trailing newline altogether: line1 = raw_input('type start') start = 'start' if line1 == start: line2 = raw_input('what website want open?') b.open(line2) python if-statement printing
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
sql - ORDER BY and GROUP BY doesn't work for me -
sql - ORDER BY and GROUP BY doesn't work for me - i've table called "emps" contain 5 cols (id, name, gender, birthdate, profession) , need select * emps order id grouping gender, birthdate but doesn't work!! any help.. thanks since gender , birthdate grouping items,so must select items. select gender ,birthdate emps grouping gender,birthdate,id order id sql vb.net order group
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
objective c - Collision Being Detected before Collision Takes Place -
objective c - Collision Being Detected before Collision Takes Place - in next code seek , observe if code detecting collision. before bullet , line collides, debugger says "collided!" //collision detector -(bool)viewsdocollide { if(cgrectintersectsrect(_bullet.frame, _line.frame)) { homecoming yes; } else { homecoming no; } } //so turrets shoot - (ibaction)shooterbutton:(id)sender { [self mover:(id)sender]; } - (void)mover:(id)sender { cgrect bulletframe = _bullet.frame; cgrect lineframe = _line.frame; [uiview animatewithduration:2 animations:^{ cgrect newframe = cgrectmake(bulletframe.origin.x + lineframe.origin.x - 14, bulletframe.origin.y, bulletframe.size.width, bulletframe.size.height); _bullet.frame = newframe; }]; bool collisiondetector = [self viewsdocollide]; if (collisiondetector == yes) { nslog(@"collided!"); } } i presume collision "taking place" before because have set position bullet. how "shoot" bullet without using [uiview animatewithduration]? or, how code observe collision when happens? your collision detection code not within animation running. you've asked os animate 1 frame another, happen after function has returned (on ui thread). so, you're detecting collisions before animation has started. if want 2d game, recommend using cocos2d. has high-level back upwards want do. objective-c collision-detection
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
c# - How to catch and save json data posted to restful asp.net web api -
c# - How to catch and save json data posted to restful asp.net web api - i have code: [route] public httpresponsemessage postdata[frombody] datamodel data) { ... implementation... } this automatically binds / converts json info data model. however, save / grab raw json file posted , save logging purposes. suggestions on how can accomplish this? you can below , utilize json converter convert string json later. [httppost] public httpresponsemessage postdata([frombody] string text) { // log text. datamodel info = jsonconvert.deserialize<datamodel>(text); } or can do, [httppost] public httpresponsemessage postdata() { string text = request.content.readasstringasync().result; //log text datamodel info = jsonconvert.deserialize<datamodel>(text); } since mention logging, might want consider doing in web api filter or delegating handler - create logic more centralized instead of having logic in each action method. public class logapirequest : actionfilterattribute { public override void onactionexecuting(httpactioncontext actioncontext) { var text = actioncontext.request.content.readasstringasync().result; mylogger.log(loglevel.info, text); base.onactionexecuting(actioncontext); } } and register filter - typically in webapiconfig.cs or decorate action method or controller class filter. config.filters.add(new logapirequest()); c# asp.net json asp.net-web-api
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
php - Mongodb, using aggregate combined with filter? -
php - Mongodb, using aggregate combined with filter? - i'm trying convert php script based in mysql database run on mongodb database. have resolved major queries except one. imagine have library (this collection), every document book entry. need know how many distinct authors in library wroten in language (another field). at moment have code , don't know how continue: $test = array( array( '$group' => array( '_id' => array('author' => '$author' ) ) ) ); $out = $db->$collection->aggregate($test); thanks. if want set filter, need start pipeline $match,the command be: db.collection.aggregate([ { "$match" : {lang : "en"} }, {"$group":{"_id": {"author" : "$author"} , "total" : {"$sum" : 1} }} ]) if convert php be: $test = array( array('$match' => array("lang" => "en")), array( '$group' => array( "_id" => array('author' => '$author'), "total" => array('$sum' => 1) ), ), ); in case have pass language in first step (match/filter). if want "all languages" need set language in $group operator db.collection.aggregate([ {"$group":{"_id": {"author" : "$author", lang : "$lang"} , "total" : {"$sum" : 1} }} ]) i allow force in php you can find more informations $match here: http://docs.mongodb.org/manual/reference/operator/aggregation/match/ php mongodb aggregate
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Android MediaMuxer readSampleData IllegalStateException -
Android MediaMuxer readSampleData IllegalStateException - i using next code generate video. however, 1 in every 5 attempts readsampledata raises either illegalargumentexception or illegalstateexception. can stop exceptions. can check state of extractor before calling readsampledata. if so, how? mediaextractor videoextractor = new mediaextractor(); videoextractor.setdatasource(source); log.d(tag, "video extractor track count " + videoextractor.gettrackcount() ); mediamuxer muxer = new mediamuxer(outputfile, mediamuxer.outputformat.muxer_output_mpeg_4); videoextractor.selecttrack(0); mediaformat videoformat = videoextractor.gettrackformat(0); int videotrack = muxer.addtrack(videoformat); log.d(tag, "video format " + videoformat.tostring() ); boolean videoended = false; long videotimestamp = 0; int framecount = 0; int offset = 100; bytebuffer videobuf = bytebuffer.allocate(max_sample_size); bufferinfo videobufferinfo = new bufferinfo(); muxer.start(); while (!videoended) { videobufferinfo.offset = offset; videobufferinfo.size = videoextractor.readsampledata(videobuf, offset); if (videobufferinfo.size < 0) { log.d(tag, "video ended " + videobufferinfo.size); videoended = true; videobufferinfo.size = 0; } else { videotimestamp = videobufferinfo.presentationtimeus = videoextractor.getsampletime(); videobufferinfo.flags = videoextractor.getsampleflags(); muxer.writesampledata(videotrack, videobuf, videobufferinfo); videoextractor.advance(); framecount++; log.d(tag, "frame (" + framecount + ") video presentationtimeus:" + (videobufferinfo.presentationtimeus/1000000.0f) +" flags:" + videobufferinfo.flags +" size " + videobufferinfo.size); } } muxer.stop(); muxer.release(); the actual code adds sound video after video extractor loop. android illegalstateexception illegalargumentexception mediacodec mediamuxer
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
vbscript - Populating the Condition of IF statement from a database in
SQL Server -
vbscript - Populating the Condition of IF statement from a database in SQL Server - i want populate status of if statement table in database stored in sql server. retrieving status sql server using: ... sql_cond = "select cond condition" recordset.open sql_cond,connstring cond = recordset(0).value msgbox cond ... this shows status in msgbox, status '0.8*table_a_rows > table_b_rows' stored varchar in sqlserver. want utilize status in if statement follows ... if (cond) ... 'process ... end if so can status string typecasted datatype not show type mismatch , when placed within parameter of if? feasible ? the next works in vbscript: ... dim cond = a>b 'which datatype this?? lets phone call status info type if (cond) msgbox "a>b" else msgbox "a<b" but can string converted status info type usage in if statement? eval() should want. sql-server vbscript
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
ruby on rails - Delayed Job not scheduling on time -
ruby on rails - Delayed Job not scheduling on time - i have next delayed job setup in model follows: def expire_listing(listing_id) puts "expiring" end handle_asynchronously :expire_listing, :run_at => proc.new { 1.minutes.from_now } however when delayed job gets scheduled follows: #<delayed::backend::activerecord::job id: 5, priority: 0, attempts: 0, handler: "--- !ruby/object:delayed::performablemethod\nobject...", last_error: nil, run_at: "2014-10-23 18:13:00", locked_at: nil, failed_at: nil, locked_by: nil, queue: nil, created_at: "2014-10-23 18:12:00", updated_at: "2014-10-23 18:12:00"> you can notice run_at time 4 hours ahead (2014-10-23 18:13:00) of current time 2014-10-23 14:12:00 how can prepare runs 1 min current time? try using gem, it's useful https://github.com/kensodev/perform_later ruby-on-rails rails-activerecord delayed-job
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
python pygame dont recognize keyboard event -
python pygame dont recognize keyboard event - i want create programme move rectangle via keyboard when runs doesnt moves dont understand event commands cant find whats wrong have done think problem sequence of command beginner cant find can help me thnks! import pygame import sys pygame.locals import * fps = 30 fpsclock = pygame.time.clock() w = 640 h = 420 bluish = (0, 0, 255) white = (255, 255, 255) x = w / 3 y = 350 boxa = 20 movex = 0 def drawwindow(): global screen pygame.init() screen = pygame.display.set_mode((w, h)) screen.fill(blue) def drawbox(box): if box.right > (w - boxa): box.right = (w - boxa) if box.left < 0: box.left = 0 pygame.draw.rect(screen, white, box) def main(): global x global movex drawwindow() box1 = pygame.rect(x, y, boxa, boxa) drawbox(box1) while true: event in pygame.event.get(): if event.type == quit: pygame.quit() sys.exit() if event.type == keydown: if event.key == k_right: movex = +4 if event.key == k_left: movex = -4 if event.type == keyup: if event.key == k_right: movex = 0 if event.key == k_left: movex = 0 x += movex pygame.display.update() fpsclock.tick(fps) if __name__ == '__main__': main() keyboard events beingness accepted properly. can verified sticking print statement within 1 of if event.key == ... blocks. one of problems never redrawing box after drawing it. every iteration of game loop should redraw background (ideally area changes, that's later) , box in new position. this: while true: # [event handling code omitted brevity] x += movex drawwindow() drawbox(box1) pygame.display.update() fpsclock.tick(fps) however there's problem. changing x or movex has no effect on anything, because not used anywhere 1 time main loop entered. rather x += movex, box move if x attribute changed, in next code: while true: # [event handling code omitted brevity] box1.x += movex # line changed drawwindow() # line added drawbox(box1) # line added pygame.display.update() fpsclock.tick(fps) running code changes above, box moves. python events pygame
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
python - Attempting to stream Twitter Timeline with Tweepy but always
get unfiltered JSON -
python - Attempting to stream Twitter Timeline with Tweepy but always get unfiltered JSON - i'm working on python app stream twitter using tweepy. whenever seek stream timeline block of reddish json. i've checked online extensively , seek yields same results. def main(): screen_name = '****' ckey = "****" csecret = "****" atoken = "****" asecret = "****" auth = tweepy.oauthhandler(ckey, csecret) auth.set_access_token(atoken, asecret) api = tweepy.api(auth) auth = oauthhandler(ckey, csecret) mainmenu(ckey,csecret,atoken,asecret,auth,api) def mainmenu(ckey,csecret,atoken,asecret,auth,api): print("welcome pytwit app!") option=int(input("please select 1 home timeline, 2 tweet, 3 search. ")) if option==1: tweetstream(ckey,csecret,atoken,asecret,auth,api) elif alternative ==2: posttweet(ckey,csecret,atoken,asecret,api) elif alternative ==3: search() else: print("invalid entry, please seek again.") mainmenu(ckey,csecret,atoken,asecret,auth,api) def tweetstream(ckey,csecret,atoken,asecret,auth,api): screen_name = 'jen_b_mart' auth = oauthhandler(ckey, csecret) stream = api.home_timeline(creen_name = screen_name) decoded = json.dumps(stream, sort_keys=true) print"(%s) %s" % (decoded["created_at"], decoded["text"]) print("\n\n") mainmenu(ckey,csecret,atoken,asecret,auth,api) main() python json twitter timeline tweepy
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Sharepoint - Download editable file from url in chrome -
Sharepoint - Download editable file from url in chrome - we have been stuck on using net explorer in company 1 single reason: when click on sharepoint link document in ie, opens file editable. when save it, automatically saved on server. on other hand, chrome or other browsers, downloads copy of file, user might loose changes because thinks file saved on server whereas not... anyone thinks of solution that? thanks ! there similar resolved question yours right here: how open sharepoint files in chrome/firefox give shot! sharepoint
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
c - code compiled fine but ran into segmentation fault: 11 when run -
c - code compiled fine but ran into segmentation fault: 11 when run - can somone please help me code?. compiled fine when seek run it give me segmentation fault: 11. don't know did wrong. suspect adddetailtoaccumulators function problem of it, can't seem find flaw. main.cpp #include <stdio.h> #include <stdlib.h> #include <string.h> #include "function.h" #define onscreenreport1 "employee pay reg hrs gross fed ssi net \n" #define onscreenreport2 "name rate ovt hrs pay state defr pay \n" #define onscreenreport3 "======== ===== ======= ======= ======= ====== =====\n" extern void calctax(float gross, float deffered, float *fedtax, float *statetax, float *ssitax); int main(void) { int numemps; float fedtax, statetax, ssitax, hours, payrate, defr, netpay,gross, reghrs, ovthrs, totreg, totovt, totpayr, totgross, totfed, totstate, totssi, totdefr, totnetp; char lastname[10], firstname[10], reply = 'y'; file *reportfile; printreportheadings(reportfile); initializeaccumulators(&totpayr, &totreg, &totovt, &totgross, &totfed,&totstate, &totssi, &totdefr, &totnetp); while (answer == 'y') { employeedata(lastname, firstname, &hours, &payrate, &defr); if (hours <= 40) { reghrs = hours; } else { reghrs = 40; ovthrs = hours - 40; } gross = calcgross(hours, payrate); calctax(gross, defr, &fedtax, &statetax, &ssitax); netpay = gross - fedtax - statetax - ssitax - defr; printf(onscreenreport1); printf(onscreenreport2); printf(onscreenreport3); printf("%s, %s %f %f %f %f %f %f\n", lastname, firstname, payrate, reghrs, gross, fedtax, ssitax, netpay); printf("your reg hours %.2f\n", reghrs); printf("your overtime hours %.2f\n", ovthrs); printf("your gross is: %.2f\n", gross); printf("the federal taxation %.2f\n",fedtax); printf("the state taxation %.2f\n",statetax); printf("the ssi taxation %.2f\n",ssitax); adddetailtoaccumulators(payrate, &totpayr, reghrs, &totreg, ovthrs, &totovt, gross, &totgross, fedtax, &totfed, statetax, &totstate, ssitax, &totssi, defr, &totdefr); numemps++; printf("have more employee? "); scanf("%c", &answer); } printsummaryreport(totpayr, totreg, totovt, totgross, totfed, totstate, totssi, totdefr, totnetp, numemps, reportfile); homecoming 0; } function.h void printreportheadings(file *reportfile) { reportfile =fopen("report.txt","w"); if (reportfile != null) { fprintf(reportfile, "employee pay reg hrs gross fed ssi net \n"); fprintf(reportfile, "name rate ovt hrs pay state defr pay \n"); fprintf(reportfile, "======== ===== ======= ======= ======= ====== =====\n"); } else { printf("could not open file.\n"); exit(0); } } void employeedata(char *lastname, char *firstname, float *hours, float *payrate, float *defr) { printf("last name?\n"); scanf("%s", lastname); printf("first name?\n"); scanf("%s", firstname); printf("hours?\n"); scanf("%f",hours); printf("payrate?\n"); scanf("%f",payrate); printf("defr?\n"); scanf("%f",defr); } float calcgross(float hours, float payrate)//module 3.4 { if (hours < 40) homecoming (hours * payrate); else homecoming payrate * 40 + (hours - 40)*1.5*payrate; } void initializeaccumulators(float *totpayr, float * totreg, float *totovt, float *totgross, float *totfed, float *totstate, float*totssi, float *totdefr, float *totnetp) { *totpayr = 0; *totreg = 0; *totovt = 0; *totgross = 0; *totfed = 0; *totstate = 0; *totssi = 0; *totdefr = 0; *totnetp = 0; } void adddetailtoaccumulators(float payrate, float *totpayr, float reghrs, float *totreg, float ovthrs, float*totovt, float gross, float *totgross, float fedtax, float *totfed, float statetax, float *totstate, float ssitax, float *totssi, float defr, float *totdefr) { *totpayr = *totpayr + payrate; *totreg = *totreg + reghrs; *totovt = *totovt + ovthrs; *totgross = *totgross + gross; *totfed = *totfed + fedtax; *totstate = *totstate + statetax; *totssi = *totssi + ssitax; *totdefr = *totdefr + defr; } void printsummaryreport(float totpayr, float totreg, float totovt, float totgross, float totfed, float totstate, float totssi, float totdefr, float totnetp, int numemmps, file *reportfile) { float avgpayr, avgreg, avgovt, avggross, avgfed, avgstate, avgssi, avgdefr, avgnetp; avgpayr = totpayr / numemmps; avgreg = totreg / numemmps; avgovt = totovt / numemmps; avggross = totgross / numemmps; avgfed = totfed / numemmps; avgstate = totstate / numemmps; avgssi = totssi / numemmps; avgdefr = totdefr / numemmps; avgnetp = totnetp / numemmps; fprintf(reportfile, "totals %f %f %f %f %f %f \n",totpayr, totreg,totgross, totfed,totssi,totnetp); fprintf(reportfile, "averages rate ovt hrs pay state defr pay \n"); fprintf(reportfile, "averages rate ovt hrs pay state defr pay \n"); fprintf(reportfile, "======== ===== ======= ======= ======= ====== =====\n"); fclose(reportfile); } i ran , got result last name? teo first name? dg hours? 30 payrate? 10 defr? 15 employee pay reg hrs gross fed ssi net name rate ovt hrs pay state defr pay ======== ===== ======= ======= ======= ====== ===== teo, dg 10.000000 30.000000 300.000000 42.750000 22.087500 217.170013 reg hours 30.00 overtime hours 0.00 gross is: 300.00 federal taxation 42.75 state taxation 2.99 ssi taxation 22.09 segmentation fault: 11 update: although concrete environment segmentation fault appears occur other reason (i missed output listing indicates programme passed beyond info input), writing standards-compliant c code must avoid scanf("%f",hours); scanf("%f",payrate); scanf("%f",defr); where hours, payrate, defr refer numeric variables (float). this described programming error @ http://www.drpaulcarter.com/cs/common-c-errors.php#2.3.1 , tested myself code #include <stdio.h> float f = 0.; main() { scanf("%f", f); printf("f = %f\n", f); } with "gcc" either leads segfaults or not read info (on different boxes). scanf() needs pointers variables, not values, although respect strings there no difference. compilers perchance may substitute pointers in rogue code making run particular compiler, code non-portable. c
Posted by
Unknown
at
03:22
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)
About Me
Unknown
View my complete profile
Blog Archive
►
2015
(1691)
►
September
(185)
►
August
(196)
►
July
(196)
►
June
(172)
►
May
(190)
►
April
(212)
►
March
(179)
►
February
(169)
►
January
(192)
►
2014
(1709)
►
September
(196)
►
August
(183)
►
July
(185)
►
June
(190)
►
May
(196)
►
April
(207)
►
March
(207)
►
February
(170)
►
January
(175)
▼
2013
(1661)
►
September
(198)
►
August
(166)
►
July
(190)
►
June
(162)
▼
May
(192)
windows - Shared file access between Python and Ma...
javascript - Dropdown List - Display Value Instead...
c# - Generate Enum from Lookup Tables - EF 6 -
r - Creating a column that has the count of elemen...
sql server - Query error with 2 ambiguous column n...
scope - Externally scoped variables in IronPython ...
spring - Best practice to access and display data ...
php - Ubuntu sendmail only sends to localhost -
mysql - Writing an sql query that uses count -
java - @RequestPart("json") as a property in Model...
validation - Validating a date in java -
java - Why can not I assign method reference direc...
mysql - Convert dates into weeks -
python - Why do I still have optparse being used i...
objective c - xcode/ios: delegate not working with...
javascript - How can I hide one div before opening...
Efficiently inserting a decimal in perl string -
c# - How to check if an XML attribute contains a s...
php - Using eloquent select related entries after ...
javascript - Get HTML Code of Element (innerHTML +...
javascript - Canvas animating a pie chart -
java - How to use CXF client in thread safe way -
mysql - Query cannot be parsed, please check the s...
delphi - Make $DEFINE permanent across several mod...
java - How do I get the result code from SQLExcept...
Undo layout in R -
nsstring - Objective C should these two return the...
haskell - GHC cannot find dynamic libraries - Coul...
linux - Can I/How do I force micro-SD card to r/w ...
data visualization - Plot all columns in a file us...
ios - How can you make a UITextfield give suggesti...
excel - How do I keep VBA from putting output into...
python - Strange NameError: name 'math' is not def...
php - Page hits counter - Am I overexerting the da...
regex - Correct wrongly formatted dates -
What's a good way of adding and remove object deta...
Canvas custom shape fill issue -
Magnific popup - undefined is not a function when ...
php - Graphical mode in phpseclib -
Cakephp 3.0 login as Anonymous -
javascript - List all the extensions installed in ...
Magento Add fee on grand-total depending about pay...
Creating String Array joining elements of 2 arrays...
php - short links without htaccess how? -
.net - ItemsControl fill order -
jquery - Wordpress collapsing menu keeps not expan...
python - Print won't work in if statement -
sql - ORDER BY and GROUP BY doesn't work for me -
objective c - Collision Being Detected before Coll...
c# - How to catch and save json data posted to res...
php - Mongodb, using aggregate combined with filte...
Android MediaMuxer readSampleData IllegalStateExce...
vbscript - Populating the Condition of IF statemen...
ruby on rails - Delayed Job not scheduling on time -
python pygame dont recognize keyboard event -
python - Attempting to stream Twitter Timeline wit...
Sharepoint - Download editable file from url in ch...
c - code compiled fine but ran into segmentation f...
php - Simple jQuery AJAX file upload -
PHP - Search String And Remove Element in Json -
angularjs - Uncaught Error: No module: firebaseSim...
c++ - Compile Program Using Opencv Libraries -
node.js - Yodlee addSiteAccount1 failing to regist...
php - Dynamic validation groups in Symfony Forms -...
java - Scala - Extending a reference type without ...
c# - When mouse is moved open AppBar -
ios - Stop automatic Zbar camera rotation -
Custom password requirements on forgot password/ p...
selenium webdriver - Delete Text in a textfield -
R. Import many .csv files at once, while skipping ...
How to query APIGEE for missing attribute -
java - CORS ~ JQuery ~ XMLHttpRequest cannot load
...
java - Unable to Autowire a DAO when using Spring ...
.Net Regex match only if input ends or with Newlin...
jsf - f:setPropertyActionListener does not set pro...
XML parsing ampersand in Scala -
TortoiseSVN: How to update multiple directory in a...
parsing - Fedora Package Changelogs -
sql - Collation help needed -
internet explorer 8 - img tag doesn't work in ie8 -
javascript - Steps to Minify JS and CSS in SVN win...
python - Save path from leaves to root using ete2 -
ember.js - Add second model to a route -
how to detect silverlight plugin settings from sil...
Embedded Jetty 9: How to create a request to pass ...
git: How to refresh a commit that isn't on top -
html - Outlines and Borders not showing at all in ...
ios - Adding UIView to window is not showing in io...
Problems indexing MongoDB array in c++ -
vb.net - VB2013 & MySQL not talking properly and p...
Python mailbox on large mbox datasets -
javascript - Multiple chart export in HighChart is...
c# - How to check if an item exists in the checkbo...
windows phone 8.1 - Change in TextBox VisualState ...
javascript - Dynamically generated slider will not...
c# - 2-dimensional arrays not assigning values -
php - How to assign object's parameter based on it...
resources - Constant states do not match in develo...
MySQL AUTO_INCREMENT cannot be updated -
java - Design pattern for page logging -
►
April
(183)
►
March
(212)
►
February
(185)
►
January
(173)
►
2012
(1651)
►
September
(166)
►
August
(196)
►
July
(186)
►
June
(194)
►
May
(178)
►
April
(161)
►
March
(189)
►
February
(181)
►
January
(200)
►
2011
(1655)
►
September
(174)
►
August
(212)
►
July
(189)
►
June
(161)
►
May
(181)
►
April
(183)
►
March
(197)
►
February
(186)
►
January
(172)
►
2010
(1664)
►
September
(170)
►
August
(174)
►
July
(177)
►
June
(199)
►
May
(187)
►
April
(191)
►
March
(196)
►
February
(195)
►
January
(175)
Simple theme. Powered by Blogger.