Monday, 15 February 2010

mysql - SQL Update using values from other columns in same table -


मेरे पास एक SQL तालिका है, "डेटा", निम्न कॉलम के साथ: id (int), date1 (datetime), date2 (Datetime), अंतर (फ्लोट)

मैं इस तालिका को अपडेट करना चाहूंगा ताकि "अंतर" कॉलम में फरवरी (एक फ्लोट के रूप में) की तारीख 2 और दिनांक 1 के बीच अंतर हो, केवल जब date2 '0000-00-00 00:00:00' के बराबर नहीं है

मैं लाइनों के साथ कुछ की सोच रहा था

  अद्यतन डेटा m SET difference = datediff (" Hh ", m.date2, m0.date1) / 8765 - प्रति वर्ष 8765 घंटे हैं इसलिए यह मुझे मेरी फ्लोट से डेटा M0 WHERE देना चाहिए एमएड = एम 0.आईडी और एम डीटीटी 2 & lt; & gt; '0000-00-00 00:00:00';  

फिर भी जब मैं कोशिश करता हूं मुझे "SQL वाक्यविन्यास त्रुटि बताते हुए एक त्रुटि मिलती है। पास के डेटा का उपयोग करने के लिए सही वाक्य रचना के लिए अपना MySQL सर्वर संस्करण जांचें SET अंतर = दिनांकित (" hh, m.date2 , M0.date10 / 8765) लाइन से 1 '' से ''

वांछित परिणाम पाने के लिए मैं अपने एसक्यूएल स्टेटमेंट को कैसे संशोधित करूं?

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

मैं इस एसक्यूएल स्टेटमेंट को चलाने के लिए xampp के phpMyAdmin इंटरफ़ेस का उपयोग कर रहा हूं

बयान प्रपत्र पर होना माना जाता है:

  अद्यतन तालिका SET कॉलम 1 = अभिव्यक्ति 1, स्तंभ 2 = अभिव्यक्ति 2, ... कहां स्थितियां;  

आपका से खंड इस प्रकार है अप्रासंगिक।

आप अन्य तालिकाओं से लिंक करने के लिए शामिल और उप चयन करें -कुहारों का उपयोग कर सकते हैं।

- यह कैसे प्राप्त करें (वास्तव में, एक पूर्ण डुप्लिकेट):

  अद्यतन टैबिये एक जॉइन टैबिल बी पर a.join_colA = b.join_colb SET a.columnToUpdate = [कुछ]  

c# - How to return custom error message to View? -


I have created a Datasheet class, which returns an error if the selected date is in the past:

  Public category validated category: verification entry {public date time first date = date time today; // Get Public Datetime Secondend {Receive; Set; } Private contact string DefaultIncorrectDateMessage = "The date you entered is incorrect, please try again"; Public String Date InPastMessage {get; Set; } // Public String DateNote Orange Message {get; Set; } Protected Override Validation Result IsValid (Object Value, Validation Contact Validation Contact) {// Your Verification Logic If (Convert. DateTime (Value)> Date = Time Today) {Return Validation Results. Success; } And {new verification return (date input message ?? default incarnated date date message); }}}  

This is my view:

  [validated category (date inmemberm = "Your date is in the past. Select! ")] [Datatype (datatype.det)] Public Date Time Arrival Date {Received; Set; }  

This works correctly, though DateInPastMessage is now back in the form of a debug message, when the application fails on db.SaveChanges () is.

I want to see this message as a normal error message:

Enter image details here

How can I send my favorite error message to see? Can this be done without creating a custom jquery verification in each scene where I have a datepayer field?

You must error message in verification entry set on. I do not think that's why I do not see it.

  error message = default uncheck date messages;  

How to implement an home screen icon behaving as button in android? -


I am thinking for some and do not know how it is possible that this idea is there.

I want to create an icon on the home screen and when the user clicks on the icon light on it (the app is showing on) otherwise it is not.

Is any weather possible if yes, if yes! So how to implement it.

Thank you in advance.

Write applies your desired UI and functionality.


c# - Passing a copy of a class is altering the original copy -


I have some code that downloads the data to a class for storage and then creates a copy of that class Passed in a method that changes the data, in any way, my original class is also being changed and I am not sure what I am doing.

  calculation calc = new calculations (symbol, market); Calc.stockData = loadData (symbol, market); (Int j = calc.stockData.Count - 8; j & gt; = 0; j--) {Hypris = 0; / / 0 Latest // As you go higher in the index, this (int k = j + 1; k & lt; j + 8; k ++) {kIndex = k; JIndex = j; Decimal highwaycatcracker high = calculation CalculateReturnPercentageStatic (calc.stockData.ElementAtOrDefault (k). Close, calc.stockData.ElementAtOrDefault (j).); If (hybrid content hi hyperis) {hypermarkets = high content content hi; HighIndex = k; }} Test Test = New Test (); Test.returnPct = High Value; Test.date = calc.stockData.ElementAtOrDefault (highIndex) .det; Test.symbolClass = Symbols List. Alimentateof default (i); Calculation copy = calc; Test.ratingClass = DisplayGeneration (test.symbolClass, copy, test.date); // Sending a copy in the method to change the content. Add (test); // Here is a breakpoint and the original class (calc) has been changed}  

Let's move through your code so that you can understand what is happening here. (The words that you are asking to do are written in the comments.)

  // 1. Make a new example of the object 'calculation' on the heap / 2. Assign that example and assign it to variable 'calc' calculation calculator = new calculation (symbol, market); // 3. Create a variable called 'Copy', which indicates 'calculation' type objects. 4. Assign the value of 'Calc' (which is in the context of a lot of things); copy 'copy' = calc;  

Simply pointing to the same object in your code in the calc and copy memory. This is the reason that the change in copy is affecting calc what you need to do is clone your object so that you have a new object that is equal but memory Is different in


facebook - How can I get more data about an Instagram location-id? -


In my calls to the Instagram API, sometimes I will get this kind of location data:

 < Code> {"id": 641410285}  

As I understand, this is an Instagram location ID; I do not know what exactly it means - who handles the number? How has this been managed, and all this stuff is document anywhere? But, setting that question aside ...

There is an API to get more information about that ID. But when I call that API for this place, I get it:

  {"meta": {"code": 200}, "data": {"latitude "Wendy's"}}   

So it's probably Wendy's restaurant or someone's home, "Void", "id": "641410285", "longitude": blank, "name" Whose name is Wendy

I found what is related, if that is not the exact question, and I have got some instructions on how to start with Facebook or four squares locations / places. Go and find Instagram location-id, but does anyone have a way to learn more about an Instagram location-id?

Thanks for any indication!


python - weird issues with an IF loop -


I have a strange omission that with my loop it has the code given below:

 < Code> Diff Run_ Calculator (H, D, M, Y): If M == 01: While True: D = Calculate and Write Android (D, M, Y) if D = 31 31: Calculate and Write HDDIR (H, D, M, Y) D = 01 m = m + 1 y = y if m == 02: whereas true: d = calculate_and_write_hsdir (h, d, m, y) if d = 28 28: calculate_and_write_hsdir (h, d, M, y) d = 01 m = m + 1 if m == 03: is true: print "march" in loop "d = calculation and write / hsdir ( D, M, Y) if D == 31: calculation and write_HSDIR (H, D, M, Y) print "March complete" D = 01m = M + 1  

Basically what I am trying to do is lculate_and_write_hsdir every day, every 24 hours after it (1) i <1 p>

what I'm trying to do, turn it off As soon as it goes by the end of the month, although if I start it on 25th January then it will work properly, where this crash It was broken, but if I start it on February 01, it crashes on February 29

What am I doing wrong?

Here is how I am starting it

  h = 00 # hours d = 28 # day M = 8 # silence y = 2013 # year run_ calculate ( H, d, m, y) run_calculate (000101014) run_calculate (0001010101)  

Try, when your loop will end, because your statement requires you to make sure that when your work is done, you stop executing your existing block. You can also add a break;

  def run_calculate (h, d, m, y): if m == 01: while d & lt; = 31: d = calculate_and_write_hsdir (h, d, m, y) if d == 31: calculation and _late_hsdir (h, d, m, y) d = 01m = m + 1 y = y if m == 02: While D & lt; = 28: d = calculate_and_write_hsdir (h, d, m, y) if d = 28 28: calculate_and_write_hsdir (h, d, m, y) d = 01 m = m + 1 if m == 03: while d & lt; = 31: print "In March Loop" d = Calculation and _writing_HSDIR (H, D, M, Y) if D == 31: calculation and_writing_HSDIR (H, D, M, Y) print "March dan" D = 01 M = M + 1  

Apache File permissions issue in Ubuntu -


I am trying to use Apache to access the file on my documents folder.

I tried the following:

  sudo chown -r www-data: www-data / home / $ user / public_html sudo adduser $ USER www-data pseudo chmod- R 775 / home / $ USER / public_html  

As suggested by this post:

Although it works, I can not edit it now or The only solution to work in the form of a user (without the use of sudo ), despite being a member of the www-data group, the only solution to work in Using chmod-R 777 (which is not me In fact).

All that I had to do is restart the OS and it was sorted!


tomcat - how can I pass parameter with slash as the PathParam in rest API -


I create a restful API such as www.example.com/checking/{id} and it works well But when I pass an ID with a slash like an ACC / 123, the API path goes to www.example.com/checking/abc/123 which actually breaks the path.

I am encoded as encoded URL ID, such as ABC / 123 ABC% 2F 123, but it seems that when I use it to hit my API, it is hanging there , I can not find anything in the log

Is there any suggestion so that I can do this? Is this a Tomato configuration problem or coding problem?

Thank you,

Solutions and solutions to the problem deployed in this solution.


Libgdx BodyEditorLoader android error -


I am using libgdx 0.9.8. I am using physical-body-editor-2.9.2 () to create box 2D objects. My problem is that whenever I load a json file created by physics-body-editor, using the code in the libgdx project:

  BodyEditorLoader loader = new BodyEditorLoader (Gdx.files .internal ("data / upspring-object.json"));  

I get an error on the Android device, "Unfortunately the app is closed!" But when I launch the desktop version on the computer, everything works just fine. Please suggest a solution Thank you!


file upload - PHP: Copying and moving image -


In the form of a title, how do I copy an image which is the directory:

  Img / user.png  

And let's suppose we have this image of

  user_files / username / putfilehere.png  

I have found some very long route for this, but I believe it can be obtained from some lines of code.

Assume that our script is located in the directory / www / and you / www / img / user Want to copy the image from png to /www/user_files/username/putfilehere.png It is very easy to do this:

  Copy ('. / Img / user.png', './user_files/username/putfilehere.png');  

ruby on rails - Trouble modelling a sports league in ActiveRecord -


Use the active record for the first time. I am looking for a small online-simulation game where I have free agency, player, team, season and post season schedule. Players should move from team to team and "compete" against each other. When I try to add all these classes together, then I am getting the problem with backcount errors, I have the structure at the moment:

Schema:

  Create_table "games", force :: waterfall do T | T.integer "visit_team" t.integer "home_team" t.integer "visit_score" t.integer "home_score" t.integer "winner" end create_table "league", force :: waterfall do. T | T.string "schedule" t.string "teams" t.string "player" end create_table "players", force :: waterfall do. T | T.string "name" t.string "position" t.integer "rating" t.integer "age" t.datetime "created_at" t.datetime "updated_at" t.integer "team_id" t.boolean "free_agent" end create_table "Program", Force :: Waterfall do. T | T.integer "game" end create_table "teams", force :: waterfall do | T | T.string "name" t.string "location" t.integer "wins" t.integer "losses" t.integer "rating" t.datetime "created_at" t.datetime "update_at" end  

And here are the links:

  The class team & lt; ActiveRecord :: Base has has_many (: player) has_many (: game) belong_to (: league) end class schedule & lt; ActiveRecord :: Base has_many (: Games) belong_to (: League) and Class Player & lt; ActiveRecord :: Base is_to (: Team) has_many (: Games) belong_to (: League) and Class League & lt; ActiveRecord :: Base_On (: schedule) has_many (: teams) has_many (: players) and class games & lt; Question: Do I need to add foreign key relationships for example between league and players / teams? Do not say documentation, but I can not understand how a player can relate to the league without reference to a primary / foreign key. Also, I am also unsure how to structure the schedule class. I'm not sure which features mean that I want to be able to compete for each team in many games and there is a schedule for each of them to be ready. I am a newbie, therefore, while pointing out the good resources for active resources (which do not fully understand the documents, besides), I would be very helpful! 


Gradle/Maven configs for Artifactory Java Client -


I am trying to use my code and in Gradle Build but can not know some details about JR:

  • What should accurate mavenRepo should be used to find jar in my build.gradle < / Li>
  • Should I use the latest stable official version? According to this, it is either 0.17, 0.7 or 0.10, depending on which link you go to, according to mvnrepo.org , this is 0.16.
  • What's the latest / static / official version ( group: artifact: version.jar what are the grade coordinates?)? Again, because I can not tell that the binary repo is hosting this Jar, nor is it officially latest / stable, it is almost impossible to determine the proper coordinates.
  • Update:

    This is the answer to the first question (Mewen Repo):

      Maven {url "http: //dl.bintray/Code>  

    It looks like 0.17 is also the official stable / latest version.

    < Strong> therefore still need help with Gradal / Maven coordinates. Excluding these answers here, if future people are surprised at the same thing.

< P>

Artificial Java Clients Officially You can use the Maven Repos mentioned, or you can make better use of the binder:

  repositories {jcenter ()}  
< P> 0.17 is actually the latest version. You can use this url to get the latest version in Bintray -
You are following the necessary coordinates to use:

  compile (Group: 'org.jfrog.artifactory.client', name: 'artistic-java-client-services', version:' 0.17 ', ext:' j Ar ')  

join - Joining two data.tables in R based on multiple keys and duplicate entries -


I am trying to get involved in two grounds. There are many setkeys in the R base and those repeated entries as an example

  & gt; DT1 ID Month of the year 1 IL January 3 2013 1 IL January 3 2014 1 IL January 3 2014 1 IL January 10 2014 1 IL January 11 2013 1 IL January 30 2013 1 IL January 30 2013 1 IL Feb 2 2013 1 IL February 2 2014 1 IL Feb 3 2013 1 IL Feb 3 2014 & gt; DT 2 State Month Day Year TAh IL Jan 1 2013 13 IL Jan 2 2013 1 9 IL Jan 3rd 2013 22 IL January 4 2013 23 IL January 5 2013 26 IL January 6 2013 24 IL January 7 2013 27 IL January 8 2013 32 IL January 9 2013 36 ... ... ... ... .... ... ... IL 31 December 2013 33  

I would like to add the "TAV" values ​​of DT2 to the respective dates in DT2. For example, all entries in DT1 will be held on January 3 2013 will require a further 13 in an additional column.

I created the following setkey (DT1, state, month, day, year) and the same DT2 for an integrated operation DT1 [DT2, nomatch = 0, Permission cartesian = TRUE but it does not work

Just a friend's help with this (That could not get a good stack overflow answer), so I thought this question requires a more "toy" answer.

Here are some simple data tables with a mismatch key:

  dt1 < - data.table (a = letter [1: 5], b = letters [1: 5], c = 1: 5) dt2 & lt; - data.table (c = LETTERS [c] (1: 4,6)], B = letter [1: 5], A = 6: 10)  

And many more here The merge options are:

  merge (dt1, dt2, by.x = c ("a", "b"), by.y = c ("c", "b")) #inter mergence merge (dt1, dt2, by x = c ("a", "b"), by.y = c ("c", "b"), all = t) # external joint setkey (dt1, A, B) DT 2 [DT1] # Left (DT1 is the "left" table) DT1 [DT2] #Wright Join (if DT1 "left" table) (DT 2, C, B) DT2 [DT1] Is)  

facebook graph api - Django-allauth retrieve avatar profile pictures -


मैं django-rest-auth और django-allauth के बारे में उपयोग करता हूं उपयोगकर्ता का पंजीकरण / यूजर के फेसबुक प्रोफाइल का इस्तेमाल कर लॉगिन।

अब, मैं फेसबुक से कुछ मानक जानकारी ले सकता हूं (सभी ऑथेंट के लिए डिफ़ॉल्ट)।

अवतार-चित्रों की सूची को भी प्राप्त करना संभव है ? यह सब ऑल्यूथ में कैसे बना सकता है?

यदि आप एक डीजेango टेम्प्लेट में अवतार चित्र प्राप्त करना चाहते हैं:

  & lt; img src = "{{user.socialaccount_set.all.0.get_avatar_url}}" / & gt;  

क्या आप जो करने की कोशिश कर रहे थे?


How to view the omitted output in R software? -


In some circumstances the software intentionally leaves some results with the "..." sign, for example, if any one X Using the bar chart or qcc package R is pulling the R chart, then only shows the meaning of the first sample and shows the "..." sign is there any way to see the whole output?

Example:

  #R code has been described below the Library (qcc) data = matrix (c (32, 28, 39, 50, 42, 50, 44 (Data, type = 22, 37, 32, 52, 42, 45, 29, 52, 35, 42, 40, 28, 31, 34, 21, 35, 44), 8, 3, bio = TRUE) "Xbar") # If we run it then the output will be displayed below 11 list call: language qcc (data = data type = "xbar") $ type: chr "xbar" $ Data.name: chr "data" $ data : Number [1: 8, 1: 3] 32 28 39 50. . $ Figures: nominated number [1: 8] 37 33.3 39.7 41. .  

How can I see full output without "..." symbols?

You need to save the result of the call to qcc . You will then see that the result is of the class qcc qcc objects print.qcc actually the call method for call str , Which is responsible for shortening the result. You can display the entire result with the example unclass . . / html>

iphone - WatchKit extension doesn't see updates to NSUserDefaults for App Group -


I have seen some questions on this, and have tried all the given answers, and it still does not work Is me

I am trying to share many small statistics (strings and balls) between my iPhone app and its watchkit extension. (If it makes a difference, then the information is being read by the Glance Controller of the WK App)

Through the developer site, I have created an app group (Group.com..Scaucers-Apprentice) . If I look at 'App ID', then two identical IDs appear for one (com.theYawns.Sorcerers-Apprentice.watchkitextension) for my app (com.theYawns.Sorcerers-Apprentice). Each of them has the 'app group' enabled (for both development and distribution) and app groups selected if I edit app id.

I've turned on 'App Groups' in the capabilities for both app and extension. One concern is that from time to time - every build is not built on several days - if I go in and look at the capabilities tab, then I have a red exclamation point that states that 'Add Ape Group' entitlement to your entitlement file. If I see the entitlement file, then the entitlement happens, and if I click on the 'Fix Issue', then the red exclamation The insertion point turns into a checkmark, but the fact is that I should be worried many times per day. I have some worries.

I've refreshed my provisioning profile several times under XCode preferences, and I do not see app group icon under entitlement, if I hover, I look at the app groups in the tooltip which Pops up.

In both my app and extension, I get a reference of the user default through

  NSUserDefaults. ShareAppDefaults = [[NSUserDefaults alloc] initWithSuiteName: @ "group.com. TheYawns.Sorcerers- Apprentice"];  

I tried to add a [sharedAppDefaults synchonize] after every writing and reading my watchkit, just in case things are not being trapped is . (No difference).

My watchkit extension bundle ID is different from my iPhone app bundle ID, which I have seen on a different thread.

I have also added an NSTimer to refresh the look in every 10 seconds, so if there is a time issue with choosing changes, then I hope this update cycle or two Resolve yourself later, but it is not.

Actually stumped ... it seems that the issue of other people has been solved with the answers to other sources, but no one is working for me.

:

OK, I got an answer in the Apple Developer Forum.

This XCode appeared from the Target 'Abilities' tab, that I have all the correct entitlement sets and I can see the 'Entitlements' file in my project, open it, and see that it Was set correctly.

But - If I saw no entitlement file in the 'Code Signing' section under the 'Build Settings' tab of my app target, (These are shown correctly for all the watchkit extensions, but not for the main iPhone app).

When I plugged in the name of my entitlement file under code signing, everything worked out.

This sounds like a bug - I do not believe that the 'Buildings' tab of the 'Ability' tab and the same goal should always appear at different places for Entertainment. But to answer that which works for me, in that case anyone else is also involved in this matter.

Summary: Make sure that entitlements are correct, you must set up switches properly in the capabilities, and you see the referenced entitlement file under the build settings / code signing.


xml - Parsing CDATA with C# to get BaseCod64 -


I am trying to get baseCode64 data within my response data I am getting a return code but how can I get data inside "payload"

For example, my feedback data looks like this:

  & lt; Xml_response xsi: type = "XSD: string '& gt; & lt; [CDATA [& lt; certificateRequest> gt; return code & gt; 0 & lt; / returncode & gt; & lt; payload content_type =" application / PDF "embedded =" base64 "> SGVsbG8gV29ybGQ = & lt; / payload & gt; & lt; / certificateRequest & gt;]] & gt; & lt; / xml_response & gt;   
  XElement xmlTree = XElement.Parse (response_data); XElement returnCode = xmlTree.Element ("ReturnCode"); XText Return CODE_Value = returnCode.XText as the first node; string B1 = return CODE_Value.Value;  

Now, how do I value the value within the payload? I can convert, which I will convert to plain text or make PDF.

I tried to use it with paylaod but I do not work. I can not find anything:

  XElement returnCode = xmlTree.Element ("payload");  

If I show an element with it:

  XElement xmlTree = XElement.Parse (response_data); Excellence new_data = xmlTree.Elements ();  

I'm just getting:

0

The element payload has been displayed to me. It is very interesting but why?

You do not show the code where you are trying to access is the value of payload I'm guessing what you want to do, but try this:

  XElement payload = xmlTree.Element ("payload"); String B2 = Payload. value;  

Android Studio cannot resolve symbols from imported AAR module -


All answers from the same questions manually talk about graadel files but I have to import and build an AR file. Gradle has used Android studios to check files and all of these look correct.

My problem is:

failed import < / P>

I have imported ShowCaseView v5.0.0 R but when I try to import classes in my tutorial. Java file (you can see in red) Android studio does not recognize classrooms Android Studio recognizes that there is only one com.github.amlcurran.showcaseview.R .

I have also tried to clean up & amp; Project reconstruction, and shutdown & amp; Reopen Android Studio but it does not help.

PS As that ignore the missing XML file before I was copying them into the project

Gradle Files

ShowCaseView-5.0.0> build.gradle:

< Pre> configurations.create ("default") artifacts.add ("default", file ('ShowCaseView-5.0.0.aar'))

build my application. gradle:

  plugin apply: 'com.android.application' Android {compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig {applicationId "com.giraffeweather" minSdkVersion 19 targetSdkVersion 21 versionCode 1 versionName " 1.0 "} {buildTypes release {minifyEnabled false proguardFiles getDefaultProguardFile ('ProGuard-android.txt'), 'proguard- Rules.pro '}}} {Dependency compile FileTree (dir:' libs ', includes: [' * .jar ']) Compile' com. Android Support: App-Comt-V 7: 21.0.3 "compiled project ( ': ShowCaseView-5.0.0')}  

build.grad Le of Android Studio project:

  // Top-level build file where you can add general configuration options for all sub-projects / modules. Buildscript {repositories {jcenter ()} dependency {classpath 'com.android.tools.build:gradle:1.1.0' // NOTE: Do not keep your application dependencies here; They are related files}} {allprojects treasures {jcenter (}}}  

Gradle settings file settings.gradle build.gradle in personal module //:

  Include: App ',': ShowCaseView-5.0.0 ' 

I almost zero People know who import AAR files in this way, and I do not know that it works properly. Your results show that this is not so.

Switch to pull Jesitr the Bintre the library:

Step # 1: Change compilation project ( ': ShowCaseView-5.0.0') With compile 'com.github.amlcurran.showcaseview: library: 5.0.0'

step # 2: delete , ': ShowCaseView-5.0.0' / Code> to settings.gradle

Step # 3: Delete ShowCaseView-5.0.0 directory


collectionview - Perform segue from tapGestureRecognizer in UICollectionView? -


I learn swift from myself, I know how to do segue with a table view because it's "clickable" cell is.

My question is:

I have a collection archive that is made of UI items. I UI tags are not "clickable", I have put on tap gastre.

How do I work with those tap gestator recompilers in a wide visual controller?

Please help me (index,? DidSelectItemAtIndexPath? ...)

Maybe you can use a UIButton on your image!


Git can't switch to or delete a branch -


In GIT, I named a branch 2020 . Now I can not go to that branch, and when I try to remove it, I get the error Fatal: need for branch name . I use regular git branch-D2020 and force git branch-D2020 .

I have also tried to name the branch in quotes, but I get a single error.

I do not want this branch any more, can any such thing be done?

Update: I can check the branch using the git checkout riffs / head / 2020 , but I can not remove it from doing so.

Update 2: Navigating to / Gs / refs / then changing the name of 2020 to 2020, I deleted it. Whatever git was playing, I do not know.

The problem here is that 2020 resembles a short SHA-1 .

I have done this kind of thing before myself, which looks like words: I had a branch which I gave the name cafe or similar.

This trick is to put some non-numerical, non-"A" characters in the branch name (you can change it with git branch -m low level Method you used) so that guit can tell that this is not a SHA-1.


java - My .jsp AJAX call is returning the code from my Servlet controller instead of executing it -


I have an index.jsp that calls a Java controller that performs the operation and returns the result. If all the codes are sitting in the server then I am running on the Tommak server and calls the index page from my local machine. The problem is that the agent calling the controller is being reverted instead of executing the entire Java code in the server and bringing the result back. So I'm really getting

  import javax.servlet.http.HttpServletRequest; Import javax.servlet.http.HttpServletResponse; Public class login controller httpservlet {public login controller () {super}; }  

etc. This is ajax code:

  function loadRows () {var review_ID = location.search.split ('review =') [1]; $ .ajax ({url: "../src/mvcdemo/controllers/LoginController.java", type: "post", data: {"reviewID": review_ID}, success: function (data) {warning (data); ...}});  

PS: Java is installed on the server, and the whole project works fine. If I run it from my local host, the problem is in the communication between the local machine and the server. The URL is running on my localhost, the URL is just "Login Controller", but when the server is running, it did not get the file, so I had to use the relative path and finally to add "java".

Edit:

I am using Web.xml to define my Servlets, this code is:

   

Correct me if I am wrong but do not call your JSP controller.

Solution 1

Anyway try to use this sublet 3.0 annotation (not tested):

 < Code> import javax.servlet.http.HttpServletRequest; Import javax.servlet.http.HttpServletResponse; @WebServlet ("/ login") public class LoginController HttpServlet {public login controller () {super (); } @overराइड संरक्षित शून्य doPost (HttpServletRequest req, HttpServletResponse resp) {/ / whatever you want}}  

then

  $ Ajax ({Url: "/ login", type: "post", data: {"reviewID": review_ID}, success: function (data) {warning (data); ...}}); If you can not use servlet 3.0 annotations (which are really useful and more intuitive than web.xml),  

Solution 2

>

Then you have to use web.xml

You have to make sure that your web The XML is being loaded properly by the server.


java - File format to save data in file and How to read this data - Spring MVC -


I am a new woman for Spring MVC when working on a project, there are cases of usage, where I am from the file Some data is needed to be retrieved and it is populated in jsp.

  Public Hashmap & lt; String, ashline & lt; String & gt; & Gt; & Gt; GetFooterMoreLinks () {Hashmap & lt; String, hashmap & lt; String, Arlist & lt; String & gt; & Gt; & Gt; MyArray = New Hashmop & lt; String, Hashmop & lt; String, array list & lt; String & gt; & Gt; & Gt; (); Hashmap & lt; String, Arlist & lt; String & gt; & Gt; ValueArr = new hashmap & lt; String, Arlist & lt; String & gt; & Gt; (); ValueArr.put ("title", new arreelist & lt; string & gt; () {{add ("more link");}}); ValueArr.put ("row1", new arreelist & lt; string & gt; () {{add ("about-us"); add ("http://www.example.com");}}); ValueArr.put ("row2", new arreelist & lt; string & gt; () {{add ("investor relationship"); add ("http://www.example.com");}}); // myArray.put ("more_links", valueArr); Hashmap & lt; String, Arlist & lt; String & gt; & Gt; Partner Site Links = New Hashmop & lt; String, Arlist & lt; String & gt; & Gt; (); Partner Site LinksAreauput ("Heading", New Arreelist & lt; string & gt; () {{Ad ("Partner Heading");}}); PartnerSite LinksAreauput ("Line1", New Arreelist & lt; string & gt; () {{Add ("Support"); Add ("http://www.example.com");}}); PartnerSite LinksAreauput ("Line", "New Array" & lt; string & gt; () {{AD ("Daily Deal"); Add ("http://www.example.com");}}); // so on myArray.put ("partner_programs", partner SitesLinksArray); }  

and in jsp myArray census. EVERthing is working fine but I have to choose all these hard-coded values ​​from the file. Please help! Because .properties does not support array like file format.

.configuration stored in the .properties file

Then you have your .properties File is required, which is a standout of Java properties with the following format:

foo.properties

  some Property.key = 42 someother.property.key = The user name must be at least 5 characters long  

The format and files may be more about using. Properties can be found in files.

Your qualities are visible to spring

First of all, you need to declare bean that you use to reach your retired files.

  & lt; Bean id = "my properties" category = "org.springframework.beans.factory.config.PropertiesFactoryBean" & gt; & Lt; Property Name = "Location" & gt; & Lt; List & gt; & Lt; Price & gt; Classpath *: foo.properties & lt; / Pricing & gt; & Lt; Price & gt; Classpath *: bar.properties & lt; / Pricing & gt; & Lt; / List & gt; & Lt; / Property & gt; & Lt; / Bean & gt;  

Or when you are using the Spring Java configuration, you must

  @PropertySource ("Classpath: /com/myco/app.properties" ).  

Use values ​​in your spring beans

Then you can access the property file in your Javascript through property object.

MyClass {@Resource (name = "foo") personal property fooProperties; @resources (name = "bar") private property bar properties; // Use your properties as required}

Alternatively, you can inject solid values ​​directly from your property files. This is simple when you have a small amount of values ​​@ Value annotation, you use the property name (key) to inject its value

  @Value ("$ {some. Property.key} ") private string value;  

webrtc - Possible to emulate the lack of certain system features (such as webcam) in Chrome? -


I am a web developer and I am working with webrtc in a new application. There is no easy way to disable my webcam and microphone near OS X and I want to test / design UI components based on the lack of webcam / microphone.

Is there a way to disable or emulate it? I do not have those features so that the browser will not take and ask me to allow camera access? e.t.c?


ios - Change font of UILabel with autolayout -


आम तौर पर, आप उपयोग करते हैं:

  label.adjustsFontSizeToFitWidth = YES;  

एक लेबल बनाने के लिए जब भी अपने फ्रेम के आकार को बढ़ाने के लिए संभव नहीं है तब भी अपने फ़ॉन्ट के आकार को कम कर देता है।

क्या यह कोशिश करने का कोई तरीका है एक वैकल्पिक फ़ॉन्ट, जैसे फ़ॉन्ट आकार कम करने से पहले एक ही फ़ॉन्ट परिवार के एक संक्षिप्त संस्करण की तरह?

इस को संभालने के कुछ अच्छे तरीके आईबी में आपके लेबल का चयन करें:

विधि 1:

यदि आप प्लस बटन पर क्लिक करते हैं, तो आप किसी दिए गए आकार वर्ग के लिए विशिष्ट फ़ॉन्ट जोड़ सकते हैं।

कोड:

  - (शून्य) विशेषता कोलेक्शनडाइड चेंज: (यूआईटीड कोटिलेशन *) पिछलाट्रेड कलेक्शन {यदि (सेल्फ। विज़िटट्रेट कॉॉलिङ। हाइज़ांटालसिज़ क्लास == UIUserInterfaceSizeClassRegular & amp; सेल्फ विवलोकन.ट्रेट। चयन.विशिष्ट साइज क्लास == UIUserInterfaceSizeClassRegular ) {// ipad myLbl.Font = [UIFont fontWithName: @ "Heyo" आकार: 10]; }}  

बेहतर तरीका है, मेरी राय में, विधि 2:

इस दृष्टिकोण के साथ, आप या तो फ़ॉन्ट को एक निश्चित आकार तक सिकोड़ सकते हैं, या इसके बजाय एक स्केल फ़ैक्टर की पहचान कर सकते हैं । इन मूल्यों के साथ खिलौना जब तक आप इच्छित परिणाम प्राप्त नहीं करते मैं इस विषय में इसके बारे में भी बात करता हूं।

कोड में:

  // न्यूनतम फ़ॉन्ट आकार [myLbl सेटमिनमैनस्केलफैक्टर: MIN_FONT_SIZE / [UIFont labelFontSize]]; // स्केल कारक [myLbl सेटमिनमैनस्केलफैक्टर: 0.4];  

python - offsetbox in matplotlib has too much space at the bottom -


I am using the following to attract the text box:

Enter image details here

The text box clearly shows too many places below and enough on top is not.

Why does this happen and how can I fix it?

(Add: I've opened an over on the tracker of matplotlib )


MWE

< Pre> Import matlotlib.pyplot as plt import matplotlib.offsetbox offsetbox Import gridpec as matplotlib.gridspec Random DF scatter_plot (x, y): Ax = plt.subplot (gs [0: 2, 0: 2]) # Add text box text1 = '$ N = {} $ \ n'.format (0) text2 =' $ a = {} \ pm {} $ \ N '. Format (0.01, 0.01) text3 = '$ log (b) = {} \ pm {} $ \ n'. Format (1.2, 0.3) text 4 = '$ C _ {{(AAA)}} = {} \ Pm {} $ \ n'.format (0.2, 0.05) text5 =' $ D_o = {} \ pm {} $ \ N '. Format (10.6, 0.7) text6 = '$ E_ {{\ Odot}} = {} \ pm {} $ \ n'. Format (100., 200.) text7 = '$ F _ {{fff}} = {} \ Pm {} $' Format (0.5, 0.3) text = text1 + text2 + text3 + text4 + text5 + text6 + text7ob = offsetbox. Encarded text (text, public = 1, prop = dict (size = 12)) Ob.patch.set (boxstyle = 'square, pad = 0.2', alpha = 0.85) ax.add_artist (ob) plt.scatter (x, y) # generate random data for x = [random.random () Xrange (100)] for y = [random.random ()) xrange (100)] # Set the size of the output figure Fig = plt.figure (figsize = (30, 25)) # Make the top-level container gs = Gridspec.gridSpec (10, 12) #g Create e-Speak object # Create plot. Scatter_plot (X, Y) # Save the plot to the file. Fig.tight_layout () plt.savefig ('out.png', dpi = 150)

< P> If I want to understand well, then you

  ob = offsetbox.  

Update:

P> OK, it seems that this problem is a subscript that you are using the last line of the ATH box.

  text7 = '$ f _ {{fff}} = {} \ pm {} $' Format (0.5, 0.3)  

If you skip it, and type:

  text7 = '$ F = {} \ pm {} $ '. Format (0.5, 0.3)  

The same pad is up and down

You can use code to check the code, and from one line _ {{t}} can extract an example and see the result.

> I was only able to find this solution, if someone knows that there is a fix for this, then it would be great.


vba - Pull data from two different connections into a table excel -


I need to retrieve data from two different connection sources in Excel, then add them to a large table. These are present on different servers and I am unable to link both together in the server.

I currently have two options

1). Use the PowerPivot plugin to link two. I did this, but no solution can be found to draw the data in a table, it is only one pointable that I do not want. 2.) Write the VBA code to draw two connections, make sheets and tables for both Add loop tables and mix them in a sheet by removing two sheets. It's hard and time consuming to write and run.

Looking for priority with option 1.

Thank you!


How to send arguments to a running Process in C#? -


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

  • 32 जवाब

मैंने एक संगीत बनाया है विजुअल स्टूडियो 2012 विंडोज फॉर्म सी # का उपयोग कर खिलाड़ी। अब मैं चाहता हूं कि उपयोगकर्ता अपने प्लेयर के साथ अन्य खिलाड़ियों (विंडोज मीडिया प्लेयर, विनम्प, आदि) जैसे विंडोज एक्सप्लोरर में गाने चला सकें। मुझे फ़ाइल एसोसिएशन के लिए पहले से ही रास्ता मिल गया है!

लेकिन मुझे अपने आवेदन को कई उदाहरण (जैसे डब्ल्यूएमपी और ... नहीं) चलाने से रोकने की जरूरत है और मुझे ये गाने मिलना चाहते हैं पथ भी उन्हें भेजने के लिए मेरे आवेदन के लिए (पहले से शुरू कर दिया गया है)।

उदाहरण के लिए उपयोगकर्ता विंडोज एक्सप्लोरर में एक निर्देशिका में 3 गाने का चयन करें; मेरा आवेदन दर्ज करें / और मेरे AddFiles फ़ंक्शन को निष्पादित करें (प्लेलिस्ट में समर्थित फ़ाइलों को जोड़ें और ...)

मैंने कोशिश की है कि यह पहले भाग को हल करता है (केवल एक उदाहरण), लेकिन इससे तर्क नहीं मिल सकता << p>

मैंने भी कोशिश की लेकिन कोई मौका नहीं :( यह त्रुटि दे दी है!

** मैंने पहले ही "मैट डेविस" उत्तर की कोशिश की है और यह मेरा आवेदन सिर्फ एक उदाहरण होने के लिए और लाता है सामने का भाग बहुत बढ़िया था लेकिन उसने मेरी चलने की प्रक्रिया में तर्क नहीं भेजा था, इसलिए यह मेरी समस्या का समाधान नहीं कर सका!

कोई भी मदद अग्रिम में होगी:)

अद्यतन: मैं डॉन 'मुझे समझ में नहीं आ रहा है कि मुझे समस्या क्यों हल हो गई है क्यों विशेषज्ञों ने सवाल बंद कर दिया!' : | : /

2 अद्यतन करें (समाधान प्राप्त करें):

ठीक है अंत में मुझे समाधान मिल गया है :)

इस लिंक ने मुझे चयनित के पथ प्राप्त करने में मदद की संदर्भ मेनू आइटम पर क्लिक करके एक्सप्लोरर में फाइलें:

असली आसान :) आशा है कि यह दूसरों की भी मदद करे!

मैं इसका उपयोग करता हूं:

यह एक उदाहरण है, और कमांड लाइन आरजी का समर्थन करता है। मेरा प्रोग्राम इस तरह शुरू हो गया है:

  [STAThread] स्थिर शून्य मुख्य (स्ट्रिंग [] आर्ग्स) {Application.EnableVisualStyles (); Application.SetCompatibleTextRenderingDefault (गलत); फॉर्म 1 एमएफ = नया फॉर्म 1 (); // आपका फॉर्म सिंगल इंस्टेंस ऐपस्टास्टार.स्टार्ट (एमएफ, स्टार्टन्यू इंस्टेंस); } ... निजी स्थिर शून्य प्रारंभनई इंटरस्टेंस (ऑब्जेक्ट प्रेषक, StartupNextInstanceEventArgs ई) {स्ट्रिंग सीएमडीएआरजी = ई। कॉमांडलाइन [1]; // हाँ, 1 को पाने के लिए पहले शून्य नहीं ...}  

आपको इसकी भी ज़रूरत होगी:

<पूर्व> वर्ग सिंगल इंस्टेंस ऐपस्टार्टर {स्टैटिक सिंगल इंस्टेंस ऐप एप = रिक्त; सार्वजनिक स्थैतिक शून्य प्रारंभ (फ़ॉर्म एफ, स्टार्टअप नेस्ट इंस्टेंस ईवेंटहैंडलर हैंडलर) {यदि (ऐप == रिक्त और amp; एफ! = नल) {ऐप = नया सिंगल इंस्टेंस ऐप (एफ); } ऐप। स्टार्टअपइनएस्टेंस + = हेन्डलर; app.Run (Environment.GetCommandLineArgs ()); }}

और यह:

  वर्ग सिंगल इन्सटेंस ऐप: विंडोजफ़ॉर्मअब्सक्रिप्शनबेश {सार्वजनिक सिंगलएन्स्टेंसएप () {} पब्लिक सिंगल इन्स्टेंस ऐप (फॉर्म एफ) {base.IsSingleInstance = true; This.MainForm = f; }}  

ध्यान दें कि उन दोनों वर्गों को Microsoft.VisualBasic.ApplicationServices विधानसभा (आपको इसका संदर्भ देना होगा) का उपयोग करें।


elasticsearch - LogStash failed action with response of 500, dropping action -


I'm trying to configure LogStash to send events to view a file and elasticsearch server.

When I start the logout in the output stdout, it runs fine:

  stdout {codec = & gt; Rubydebug}  

But when I add elasticsearch output:

  elasticsearch {cluster = & gt; 'Myclustername' host = & gt; 'Mayp' node_name = & gt; The 'Aragorn'}  

Logstas start

  16 Marc 2015 3:44:24 PM org.elasticsearch.node.internal.InternalNode & lt; Init & gt; Information: [Aragorn] version [1.4.0], PID [7136], build in [BC 94 BD 8 / 2014-11-05 T 14: 26: 12 Z] March 16, 2015 3:44:24 PM Yag.Lasticistic Search Node.internal.InternalNode & LT; Init & gt; Info: [Aragon] Start ... 16 March 2015 3:44:24 PM org.elasticsearch.plugins.PluginsService & lt; Init & gt; Info: [Aragon] Load [], Sites [] March 16, 2015 3:44:25 PM org.elasticsearch.node.internal.InternalNode & lt; Init & gt; Information: [Aragorn] Arnbi to starting March 16 2015 3:44:25 PM org.elasticsearch.node.internal.InternalNode information: [Aragorn] began ... 16 Marc 2015 3:44:25 PM org.elasticsearch.transport. TransportService doStart information: [Aragorn] bound_address {Cabinet [/ 0: 0: 0: 0: 0: 0: 0: 0: 9300]}, publish_address {Cabinet [/10.98.134.83:9300]} March 16, 2015 3: 44: 25 PM org.elasticsearch.discovery.DiscoveryService doStart information: [Aragorn] myclustername / RjasP2X0ShKXEl0f2WRxBA run Marc 16, 2015 15:44:30 org.elasticsearch.cluster.service.InternalClusterService $ UpdateTask information: [Aragorn] Detected_master [Aragorn] [0YytUoWlQ2qgw2_0i5V4mQ] [SOMEMACHINE] [Cabinet [/ MYIP: 9300]] said, [[A Ragnone] [0YytUoWlQ2qgw2_0i5V4mQ] [Cabinet [/ MYIP: 9300]],}, Reason: Zen-Disco Received (from Master [[Aragorn] [0YytUoWlQ2qgw2_0i5V4mQ] [SOMEMACHINE] [Cabinet [/ MYIP: 9300]]]) March 16, 2015 15:44:30 Information started org.elasticsearch.node.internal.InternalNode: started [Aragorn]  

But when the messages begin to arrive, anything in fact L Is not sent to asticsearch and these logstash outputs start displaying in:

  Warning: [Aragon] Message (response) [28] Handler org.elasticsearch.action.sup Port.master.TransportMasterNodeOperationAction not fully read for $ 6 @ 17b 531e, error [true], resetting 16 March 2015 3:44:54 PM org.elasticsearch.transport.netty.MessageChannelHandler Receives Message Warning: [Aragorn] Not fully read (response) handler for message [29] org.elasticsearch. Action.support.master.TransportMasterNodeOperationAction$6@130 82f0, error [true], reset  

and

  {: timestamp = & gt; "2015-03-16T15: 44: 54.377000 + 0100",: Message = & gt; Unsuccessful action with feedback of 500, skipping action ...  

(The above message is too long but does not seem to include any useful diagnostics)

What could be wrong?


python - BeautifulSoup get an attribute from a find -


I'm very new to the dragon, so first of all, sorry, I print href content from any selection created with search I want to do () beautiful method but I can not do it and I do not know why I have done this. Import from imported soup from imported import soup of payload = {'btnSubmit': 'Login', 'username': 'xxx', 'password': 'xxx'} with session (): c: post ('http://www.xxx.xxx/login.php', data = Payload) request = c.get ('http: // www .xxx.xxx / xxxx ') soup = beautiful soup (request.content) row_int = soup.find (' td ', attrs = {' class': 'rnr-cc rnr-bc rnr-icons'}) print row_int [ 'Href']

but I have this error

  traceback (most recent call final): File "& lt; pyshell # 14" gt ; Line 1, & lt; Module & gt; Execfile ('C: \ Users \ Francesco \ Desktop \ prova.py') File "C: \ Users \ Francesco \ Desktop \ prova.py", line 15, & lt; Module & gt; Print line_ant ['href'] file "c: \ Python 27 \ site-packages \ bs4 \ element.py", in line 905, __getitem__ back in itself .attrs [key] KeyError: 'href'  < / Pre_> 

row_int content is like this:

  [class = "Rnr-button-img" data-mark = "view" href = "xxxxxxx" id =   

link between td tag ( a element):

line = soup.fund ('td', etters = {'class':' rnr-cc rnr-bc rnr-ick S '}) a = row.find (' a ', href = true) If one: a [' href ']

in the soup or, cum with:

  Print. Selection ('Td.rnr-cc.rnr-bc.rnr-icons a [href]'): Print a [[href]]  

ios - How do you add Apple ID's for a Custom B2B app? -


I am trying to connect to a custom B2B app iTunes, from the Epals document it appears that There should be a text box for the client apple id, but I do not like anything

here looks like an Apple document

and what I see here in iTunes Connect

How do I add Apple IDs for custom B2B apps? Delivery?

You are not crazy and are applying Apple ID correctly.

There is currently an issue with Apple's site and it is blocking the addition of Apple ID. The page will be refreshed after hitting the "Add Adapter ID" button

I tested it in Chrome, Safari and Mobile Safari. I also have an open ticket where Apple's support with its test accounts Verify this problem and mentioned that 4 other tickets are open when I said it.

Unfortunately, you can not separate anything if you do not have it already, you should call the Apple Support and start a ticket for it so that you can be notified if this is fixed. .

Edit

Took more than two weeks but iTunes connect is fixed by 04-02-2015 and you have the apple for the B2B app ID will be able to add.

Hope this will be helpful.


Wordpress: Use post Excerpt to insert a URL -


I use a part of a term to use that content in a

  & lt; A href = "& lt ;? php the_excerpt () ;? & gt;" & Gt; Link & lt; / A & gt;  

But it generates only empty space and the URL does not join well, how is any idea fixed?

Here is a screen:

Code> get_the_excerpt () . See the documentation here:

Write the result of get_the_excerpt () in a var and enter as many as you like. "The_xxx" The work is used in the loop:

Edit: I tried to reproduce your results and found the problem! Some Theme Functions (within functions.php) For each generated quote, add a "Read more" link if you use the_excerpt or get_the_excerpt.

In my case Twenty Eleven uses this topic:

  / ** * Set the post excise length to 40 words. * * To override this length in the subject of hair, remove the filter and join your own function * excerpt_length filter hook. * * @since Twenty Eleven 1.0 * * @ Ultimate int $ Length Number of characters * 0return int characters Filter Number * / Function BiseLine_XSprint_Lamp ($ Length) {Return 40; } Add_filter ('excerpt_length', 'twentyeleven_excerpt_length'); If (Function_exists ('twentyeleven_continue_reading_link')): / ** * Extras * * @since Twenty Eleven 1.0 * * @Return string Return a "Continue Reading" link "Continue Reading" HTML Link * / FunctionBeselvin_going_reading_link ( ) {Return '& lt; A href = "'esc_url (get_permalink ()).' '& Gt;' .__ ('Continue reading; & lt; span class =" meta-nav "& gt; & amp; rarr; & lt; / span Read more links with 'Elyspiris' in '[...]', 'Equine', '& lt; / a & gt;';} if end; //baseelvin_change_reading_link / ** * [...] "has been added for automatically generated fractions. * * To override it in a child theme, remove the filter and add your own * function associated with Extra_more filter hooks. * * @since Twenty Eleven 1.0 * * @ Ultimate String $ More Read More Text * @ RATTER FILDER Read More * / function BEILIEN_OUTOXSearch_Advanced ($ more) {if (! Is_admin ()) {Return '& amp; hellip;' .20eleven_continue_reading_link ();} $ return;} Add_filter ('excerpt_more', 'twentyeleven_auto_excerpt_more'); / ** * Add a beautiful "Continue reading" link in the custom post excerpts. * * Override this topic in a child theme For, remove the filter and add your own * function associated with the get_the_excerpt filter hook. * * @since Twenty Eleven 1.0 * * @ External String $ Output "Continue Reading" link * @ Layer Filtered "Continue reading" link . * / Function bisileclass_xsrint_access ($ Output) {if (Ha_akssrpt () and amp; amp; amp; Awr_aitaktment () & amp ;! Ha_admin ()) {$ output. = Twentyeleven_continue_reading_link ();} return $ output;} Add_filter ( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' );  

I have removed the above code from functions.php (to ensure that no automatic fraction is modified) and the result you are looking for Trying to do it again with it! Calling get_the_excerpt () without plain formatting or wired href The expertise.

To make sure that the rest of your page still works, I recommend making a fraction of my own rather than removing this task.


PHP code in html -


I'm not exactly behind PHP, so I'm sorry if I'm stupid

I am trying to implement a login futation, but I am unable to work the php part. Is there a code where writing the code before the html tag is wrong? Please advise.

  & lt ;? Php "config.php" is required; $ Ls- & gt; Init (); If (isset ($ _ POST ['act_login'])) {$ user = $ _ POST ['login']; $ Passed = $ _ post ['pass']; If ($ user == "" $$ pass == "") {$ msg = array ("error", "username / password wrong!"); } Else {if (! $ Ls-> Login ($ user, $ pass)) {$ msg = array ("error", "username / password wrong!"); }}}? & Gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Sign in & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; General HTML code & lt; / Body & gt; & Lt; / Html & gt;  

OK, user2760642, for whatever I remembered, I The code is slightly set:

  & lt ;? Php include_once "SOMECLASS.PHP"; $ Ls = new SOME_CLASS (); // Log-in pass is included in the method to check if (ISSAT ($ _ POST ['login'])) // Check if the user clicks, press the button. User $ = $ _ post ['login']; $ Passed = $ _ post ['pass']; If ($ user == "" $$ pass == "") {echo "error: username / password wrong!"; } And {if (! $ LS-> login ($ user, $ pass)) {resonant "error: username / password wrong!"; } Other {header ("location: mainpage.php"); // opens the main page because // log-in-pass had all rights}}? & Gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Sign in & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form method = "post" action = "loginpage.php" & gt; Login & lt; Input type = "text" name = "login" /> & Lt; Br / & gt; Password & lt; Input type = "text" name = "pass" /> & Lt; Br / & gt; & Lt; Input type = "submit" value = "click here to enter" /> & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

It is wrong to add a PHP code to the same HTML file because if the user presses the back button, the previous page will be reloaded and the PHP code will be re-executed (it will not be a different php script file With) you were remembering the login and password asking form Finally, I added the class to check the login and password in the database (AoExl. PHP).

You can copy and paste this code into a text file called the .php file, and save it to the www subdirectory. You can do this in the left (or lamp or humid) directory, Run from your browser's address bar with the local host / login page. If this does not work, try localhost: 80 / loginpage.php (if it does not turn on, call Houston because we have a problem).

I hope this helps you to learn PHP.


qt - how to set exact scene rect in QGraphicsView -


I have a problem with QGraphicsView, I do not know how to set the exact viewport for QGraphicsView. For example, Was written:

  QGraphicsScene * view = new QGraphicsScene (); QGraphicsEllipseItem * Oval; Q-Pen (QT :: Red); Qbrush Brush (Qt :: Neela); Oval = Scene-> Allepse (10,10,100,100,100,100, pen, brush); UI- & gt; GraphicsView-> SetScene (view); UI- & gt; GraphicsView-> SetSceneRect (10,10,100,100);  

I think there should be a circle to see the result in which its diameter is equal to the height or width of the viewport. But when I run the program, it shows me inside of a middle-sized circle, which means that the graphicview's view is bigger than I have specified. Why do I know any body?

I found a solution for myself: Suppose the exact graphs are the exact rectangle that you want to zoom in To:

  QRectF exact search (20, 10, 300, 200); UI- & gt; GraphicsView-> SetSceneRect (exactRect); UI- & gt; GraphicsView-> SetCenterOn (exactRect.center ()); Quatrates MTX; Mtx.scale (ui- & gt; Graphicsview- & gt; width () / exactcart (), ui- & gt; graphicsview-> height () / exact.height ()); UI- & gt; GraphicsView-> SetMatrix (MTX);  

javascript - Update an array in an angular accordion panel -


Below I have the Angular Bootstrap Empowerment and I'm trying to explain how each acordian panel will have to scope in the array properly.

For example, below I have an amarantin and inside each panel, I print an array called 'item' I am The add item adds a new item to the button array and updates every panel. My question is, how do I change the array in the panel only, where I clicked the configuration button and did not update the array in other panels? Do I need to create an instance of the item array for each panel?

  & lt; Accordion & gt; & Lt; Accordion-group ng-repeat = "Postcodlist" in the Product & gt; & Lt; Accordion-title & gt; {{Product}} & lt; / Accordion-heading & gt; & Lt; A ng-click = "addItem ()" & gt; Add item & lt; / A & gt; {{Item}} & lt; / Accordion-group & gt;  

  $ scope.items = ['item1', 'item2', 'item3']; $ Scope.addItem = function () {var newItemNo = $ scope.items.length + 1; $ Scope.items.push ('item' + no new item); };  

I think you need to create an instance of the item array for each panel is . Otherwise everything will eventually get confused. My revision:

and script:

  $ scope.postcodelist = ['post01', 'post02', 'post03']; $ Scope.itemsOfProduct = {}; $ Scope.addItemToProduct = function (index) {var newItemNo; $ Scope.itemsOfProduct [$ scope.postcodelist [index]] = $ scope.itemsOfProduct [$ scope.postcodelist [index]] || []; NewItemNo = $ scope.itemsOfProduct [$ scope.postcodelist [index]] Length + 1; $ Scope.itemsOfProduct [$ scope.postcodelist [index]]. Push ('item' + no new item); }  

Most efficient way to create multi line HTML in jQuery -


So I'm looking around and it will appear that $ (document.createElement (name)); can be the most effective way of creating HTML in jQuery.

However, if I was trying to write the HTML line then this is the best way? Can you write several lines using this method?

For example, the output I want is:

  & lt; Div id = "measurement" & gt; & Lt; Span & gt; Width: & lt; / Span & gt; & Lt; P id = "width" & gt; & Lt; / P & gt; & Lt; Span & gt; Height: & lt; / Span & gt; & Lt; P id = "height" & gt; & Lt; / P & gt; & Lt; / Div & gt;  

Not sure why you feel wrapped createElement () < / Code> "most efficient" - in that case, I would almost certainly say:

  $ (name)  

In the latter case, $ () Calls:

  var mydiv = '& lt; Div id = "measurement" & gt; + '& Lt; Span & gt; Width: & lt; / Span & gt; & Lt; P id = "width" & gt; & Lt; / P & gt; + '& Lt; Span & gt; Height: & lt; / Span & gt; & Lt; P id = "height" & gt; & Lt; / P & gt; + '& Lt; / Div & gt; ';  

vhdl - Jump from breakpoint to breakpoint in ModelSim -


What is a way to jump from breakpoint to breakpoint while debugging any design (VHDL or Verilog entry) in ModelSim ?

run-all takes control to the next breakpoint.


javascript - Constant distance from the bottom of the page -


I have a Django application where I create a PDF document using wkhtmltopdf. I have a section like code below. I want exactly 4 texts (objects) on each side but everyone is different and the text comes out of the unequal system. CSS does not help how to do this?

  & lt; Table width = "90%" range = "0" align = "center" cellpadding = "0" cellpaction = "0" style = "margin-top: 50px;" & gt; & Lt; H3 & gt; {% Trans' in progress'%} '& lt; / H3 & gt; For work_on in the executive% {work_on.all%} & lt; Tr & gt; & Lt; Td width = "33%" align = "left" valign = "top" & gt; & Amp; Nbsp; & Lt; / Td> & Lt; Td width = "67%" class = "project-name" & gt; // content & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td class = "project-image" width = "33%" align = "left" valign = "top" & gt; // content & lt; / Td> & Lt; Td class = "project-description" valign = "top" & gt; // content & lt; / Td> & Lt; / TR & gt; {% Ifloop.counter | Divisibleby: "4"%} & lt; Tr & gt; & Lt; Td square = "project-description" style = "margin-bottom: 80px;" & Gt; & Lt; Div style = "page-break-after: always;" & Gt; & Lt; / Div & gt; & Lt; / TD & gt; & Lt; / TR & gt; {% Endif%} {% endfor%} & lt; / Table & gt;  


javascript - jquery alert box simple calculation -


I want to do simple calculations using js and jquery. Regarding the values ​​in the fields, the alert box should be calculated. Here's my code:

  & lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; P id = "demo" & gt; & Lt; / P & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ ("# btn1"). Click (function () {alert ("resolution:" + $ ("# demo"). Val ());})}} ; Function myFunction (A, B) {var a; Var B; Return * b;} Document.getElementById ("Demo"). InnerHTML = myFunction (A, B);    button ID = " BTN1 "& gt; Results & lt; / Button & gt; & gt; & gt; & lt; / html>  

here:

  & lt; script & gt; $ ( Document) .ready (function Value () {// gab value $ ('# demo'). Val (myFunction ($ ('# a'). Val (), $ ('# b'). Val ()); $ ("# btn 1 ") (function () (warning (" solution: "+ $ (" # demo "). Val ());});}); function myFunction (A, B) {return A * B;} & Lt; / script> & lt; input id = "a" type = "text" value = "10" /> & lt; input id = "b" type = "text" value = "5" /> & Lt; Button ID = "BTN1" & gt; Results & lt; / Button & gt;  


java - How can I show Overlay when Incomming call in Android -


मुझे इस (लाल क्षेत्र) की तरह बनाना है

अब मैं ऐसा करता हूं। (ब्रॉडकास्ट रीसीवर, फोनस्टेट लास्टनर, इत्यादि ...) टोस्ट दिखाएं (अनदेखी 'शून्य है')

यहां छवि विवरण दर्ज करें

लेकिन मुझे पता नहीं है कि जब रिंगिंग के दौरान ओवरले दिखाना है और जब आईडीले (या जुड़ा हुआ) छिपाना है।

कोड ऐसा है

  सार्वजनिक वर्ग MyPhoneStateListener विस्तारित करता है I फोनटेस्ट लिस्टनर {संदर्भ संदर्भ; आशय का इरादा; सार्वजनिक MyPhoneStateListener (संदर्भ संदर्भ) {सुपर (); This.context = context; } @ कोलास्टेट चेंजेड (इंट राज्य, स्ट्रिंग इनकमिंग नंबर) पर @ ओवरराइड सार्वजनिक शून्य {स्विच (राज्य) {case TelephonyManager.CALL_STATE_IDLE: // पॉपअप ब्रेक छुपाएं; मामले टेलीफोनी प्रबंधक। CALL_STATE_RINGING: // पॉपअप ब्रेक दिखाएँ; डिफ़ॉल्ट: ब्रेक; }}}}  

आपको एक कस्टम टोस्ट और एक ब्रॉडकास्ट रिसीवर (जैसा आपने सही तरीके से उल्लेख किया था) यहां एक टोस्ट को कस्टमाइज़ करने के लिए एक बहुत अच्छा ब्लॉग पोस्ट दिया गया है:


How can I make all my docker containers use my proxy? -


I'm running a docker on Debian JC which is behind the corporate proxy to be able to download Docker images, I confirm that your / etc / defaults / docker

  http_proxy = "http: // localhost: 3128 /"  

I can do that work.

However, to be able to access the interweb from within your container, I will assign all sessions to - net host and then setup these env variables:

<
The host network is not required for the container, and do not want to know about the proxy (i.e. port 20, 80, in the container 443 of the host's proxy port Go through). Is this possible?

If this is unsuccessful, is it possible to set up a site, which will ensure that these envive variables are set locally but are never exported as part of an image? I know that I can pass these things with - env ​​http_proxy = ... etc, but this is clunky I use it for all users on the system without using aliases Want to do

(Disclaimer: I asked this, but the home question for Docker is a bit unclear moment).

see:

The host server is running a container with a proxy (In this case squid, which can do transparent proxying). The container has some IPTable rules that the Net Traffic in the proxy server - this means that the container needs to be run in privileged mode.

Also in the host server (and there is magic) IP route table entries which re-route all traffic from any container but proxy container via proxy proxy for port 80.

This last bit means that for port 80 traffic, from the container to the rest of the world the proxy container - it is giving chance of NAT and transparent proxy.


wpf - WF: Workflow Designer: List of InArgument added dynamically : How to get value during workflow execution -


I have created a workflow designer that allows to enter a list of email addresses. Each email in the list is an array of strings so that they can use edited / variable individually.

On my activity, I have a property that has been declared as follows:

  Viewable implementation (inrangement (string) ))  

This collection has been organized by my designer and this collection has been properly populated.

While performing the execution, I do not know how the run-time value was added for each in-instrument.

When we are executing workflow and iterating for each inragrade added to the list, I tried to get it as the value given below, but it failed:

  In the Arrangement (string of) for the adapter for each. To. The email address  string = toAddress.Get (_Context) for the slow email (<)  

The error we get is "type logic" & lt; type & Gt; "can not be used. It is an activity" that has been declared on and type is a string in my case ...

The error we understand in a way To be made because we have not declared a property on the activity it was dynamically linked to the list and it The value can not be obtained using the syntax given below:

  The_Property_Name.Get (_Context)  

Any help? I can not find anything, am I taking a different approach?

I know this because I will answer my question! Whatever we have to do, it explicitly adds the archive to the metadata by overriding the cache matadata () method on the activity. This then provides for workflow reference.

Before we add them to the context:

  Protected Override Sub Cache Metadata (Byval Metadata CodeActivityMetadata) MyBase.CacheMetadata (Metadata) I have a dim Integer = 0 as each Items in the form of InArgument (for the string) of me.To runTimeArg in RuntimeArgument = New RuntimeArgument ("to" & amp; i.ToString (), item.ArgumentType, item.Direction, false) metadata. Bind (Item, runTimeArg) metadata.AddArgument (runTimeArg) i = i + 1 next End Sub  

Then when we execute the values ​​like this

 < M> for each item InArgument (string = _Context.GetValue (items such as dim email Me.To as string)) Next  

android - EditText is not showing hint, cursor and typed text -


Hello, I have more than one editing text, each of which has hint text. I am loading EditText view in one piece. Whenever the piece is loaded, the cursor blinks for a fraction of the very left side of the text, but disappears after that even the signal is not visible and I do not see the type of text. However, when I double click in the edit text, then the entered text is selected and the text is now visible I can not find this issue.

Here is my XML for EditText:

  & lt; TableRow Android: id = "@ + id / patientName_tableRow" Android: layout_width = "wrap_content" android: layout_height = "wrap_content" & gt; & Lt; Android: text_view = "wrap_content" android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "@ string / patient_name" android: textcolor = "@ android: color / holo_blue_bright" Android: Text Syss = "20sp" /> & Lt; Android: background = "@ android: color / darker_gray" Android: id = "@ + id / editText_last_name" android: layout_width = "100dp" Android: layout_height = "wrap_content" android: layout_marginLeft = "10dp" Android: signal = " Last name "Android: inputType =" text "Android: paddingLeft =" 1dp "Android: paddingRight =" 1dp "/> & Lt; Requestfocus / & gt; & Lt; Android: layout = "id = First name "Android: inputType =" text "Android: paddingLeft =" 1dp "Android: paddingRight =" 1dp "/> & Lt; Requestfocus / & gt; & Lt; / TableRow & gt;  

Please guide me.

thanks

EditText's own XML

Android Add this to: textcolor = "# f00"

and change for whatever color is appropriate


mysql - Allow GRANT in procedures? -


I have created a process that will create a statement to allow the user with a password. I have created this process to avoid granting explicit grant permission to admin users, instead let them use the processes that I do properly. The process is as follows:

  CREATE PROCEDURE Approval (perm VARCHAR (30), Target VARCHAR (30), ID VARCHAR (8), Host VARCHAR (45) Passwd VARCHAR (45) SET @setPermissionCmd = CONCAT ('grant'), trans, 'o', target, 'to', id, '' '', hosted by '' '' '' ', Pasvadi, '' '; '); Set display @setPermissionCmd from STMT; EXECUTE set display STMt; Set DEALLOCATE PERMissionStmt; Flush Pvt .; END  

When I call In this process, I get an error code 1142 that I do not have permission for GRANT here There are two problems. One, I am executing it as the root in which all permissions should be (I have not taken it anyway, and root has created that process) . Two, when permitted to execute the process, it should be allowed to allow whatever is done inside it.

My exam:

 < Code> $ mysql -u root -p enter password: MySQL Monitor ends with the welcome order; Or your MySQL connection ID1 server version: 5.5.35-1ubuntu1 (Ubuntu) Copyright (C) 2000, 2013, Oracle and / or its affiliates All Rights Reserved. Oracle is a registered trademark of Oracle Corporation and / or its affiliates names may be trademarks of their respective owners. Type 'help;' Or '\ c' to clear the current input statement for help, type '\ c' mysql & gt; Use the exam; MySQL and gt; Create Table 'Table Test' (Unassigned `ID` INT); The query is ok, affecting 0 rows (0.00 seconds) mysql & gt; Identify user 'user test' @ 'localhost' as 'mapped'; The query is ok, affecting 0 rows (0.00 seconds) mysql & gt; Show user grants for 'user test' @ 'localhost'; + ------------------------------------------------- -------------------------------------------------- -------------- + | UserTest @ localhost for grants | + ------------------------------------------------- -------------------------------------------------- -------------- + | Grant on password '* 6C8989366EAF 7797696 AD 8AA 7A 7 FC1176A9 CEF4' * * 'User Test' @ 'Localhost'. + ------------------------------------------------- -------------------------------------------------- -------------- + 1 set in row (0.00 seconds) mysql & gt; DELIMITER // mysql & gt; If the repatriated accreditation `// query is ok, then affecting 0 rows, 1 warning (0.00 seconds) mysql & gt; `Receipts '(30), - & gt;` Target' VARCHAR (30), - & gt; `ID` VARCHAR (8), - & gt;` Host 'VARCHAR (45), - & gt; `Password` VARCHAR (45)) - & gt; BEGIN - & gt; SET @ `setPermissionCmd` = CONCAT (- & gt; 'Grant', 'Permit', 'On',` Target`, ``> TO '' ', `id`,' '' @ '' ', `Host ',' '' & gt; identified as '' ',' passwd`, '' ';'); - & gt; Prepare `set PERMissionCmd` from @ setPermissionStmt`; - & gt; EXECUTE`Setting Stmt`; - & gt; Prepare DEALLOCATE 'Presentation Stmt`; - & gt; Flush Pvt .; - & gt; END // query is OK, affect 0 rows (0.00 seconds) mysql & gt; DELIMITER; Mysql & gt; Call 'Revert' ('Select', 'Tablet', 'User Test', 'Localhost', 'Mypass'); The query is ok, affecting 0 rows (0.00 seconds) mysql & gt; Show user grants for 'user test' @ 'localhost'; + ------------------------------------------------- -------------------------------------------------- -------------- + | UserTest @ localhost for grants | + ------------------------------------------------- -------------------------------------------------- -------------- + | Grant on password '* 6C898 9 366 EAFAF 75 Bb 670 ADA 7A 7 FC 1176 A9 CEF 4' * User 'Test' @ 'Localhost'. | Select 'test'. 'User' test from 'tableTest`' @ 'localhost' | + ------------------------------------------------- -------------------------------------------------- -------------- + 2 lines set (0.00 seconds)  

java - Broadleaf Commerce admin controller not working -


I'm adding a custom section in the admin panel broadleaf commerce that reference this tutorial This is my controller class

  @Controller // @RequestMapping ( "/" + NewAdminSection.SECTION_KEY) @ safe ( "PERMISSION_OTHER_DEFAULT") public class NewAdminSection AdminAbstractController {secure permanent string preserves SECTION_KEY = "test"; @RequestMapping (value = "/ test" method = RequestMethodkGET) public string Test (Actiteepiarwlet request, Actiteepisrvet response response model) throws an exception {// This is required by the modules / units Contaneyr template, it is a custom / Custom is the template which gets involved in the body model. AddAttribute ("Custom View", "View / Test"); // Make sure navigation will be set correctlyModel Properties (Model, SECTION_KEY); / / "Set to display template custom / modules / units Container" Up / customView characterized scaffolding is installed; I} "applicationContext-servlet-admin.xml is entered in the" File I also entries in the database according to the instructions in the tutorial are also 

When I press the URL I get a blank page, call status 200 (OK) I code are also going to debug but did not call you reach your administrator, I logged in I could see that mapping mapped. Can a friend help me where I am going wrong?


wowjs - How to use a JavaScript animation effect inside a loop? -


I'm trying to add JavaScript animation effect so that I can start it:

 < Code> & lt; Top & gt; & Lt; Link rel = "stylesheet" href = "css / animate.css" & gt; & Lt; Script src = "js / wow.min.js" & gt; & Lt; / Script & gt; & Lt; Script & gt; New wow () Init (); & Lt; / Script & gt; & Lt; / Head & gt;  

and I placed square effect ( wow slideInRight ) inside my div :

  & lt is ; Div class = "line row -sm pader-LG" & gt; & Lt ;? Php foreach ($ top-> Track-> Track $ key = & gt; $ value) {if ($ ki; = $ this-> config- & gt; Items (" Item_top ")) back false; $ Image = $ value- & gt; Image [3] - & gt; Text; If ($ image == '') $ image = $ value- & gt; Image [2] - & gt; Text; If ($ image == '') $ image = base_url () "Property / Picture / No-cover .png"; ? & Gt; & Lt; Div class = "colonel-xs-6 call-sm-4 column-md-3 black-lg-2" & gt; & Lt; Div class = "item wow slides enright" & gt; & Lt; Img style = "background: url ('& lt ;? php echo $ image ;? & gt;')" /> & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;? Php}? & Gt; & Lt; / Div & gt;  

The problem is that instead of showing the effect of each single item, this javascript shows the effect at the same time for all items. What is the correct way to use this javascript on the loop?

WOW.js initialization & lt; Body & gt; not gt; , something like this:

  



        

I use the following line to import text from a PDF into R

I am
  Yuri  

However, I would like to use the URL from which I am getting PDF in my hard disk instead of PDF file in the first argument.

I suspect that the use of this line to create a local file url sample in readPDF document Does:

  Yuri and lieutenant; - sprintf ("file: //% s", system.file (file.path ("doc", "tm.pdf"), package = "TM"))  

< S> You do not need to do this for ftp or http url, just pass url as it is readPDF urls Only , so also the local file path has to be converted to URI.

You can just type:

  Yuri < - "http://cran.r-project.org/web/packages/tm/tm.pdf"  

to get the TM package documentation , Then go to readPDF :

  to read with Yuri - http://cran.r-project.org/web/ Packages / tm / tm .pdf "pdf" - readPDF (control = list (text = "-layout")) (elem = list (uri = uri), language = "en", id = "id1") <  

> ReadPDF essentially acts as a cover over external commands, so the URI is as to pdftotext (for xpdf) or whatever Use the command Or that understands the command URL, this will fail with this warning.

The only real option is to file locally Download.file with readPDF :

  Yuri <- "http: //cran.r-project. Org / web / packages / tm / tm.pdf "download. File (Yuri, "TMPDF", method = "internal", mode = "wb") PDF & lt; - readPDF (control = list (text = "-layout")) (elem = list (uri = "tm. PDF"), language = "n", id = "id1") content (pdf) [1:13 ]  

I am able to use a relative file path because the Yuri parameter has been passed, it is not considered as any URI. I was able to pass "h: \\ document \\ tm.pdf" and "h: /documents/tm.pdf" as well.


CSS Button is below where it should be -



CSS Button is below where it should be -

i have never created search bar such one, i'm trying create search bar, button touching input box. have achieved this, button lower should be, , i'm not sure why.

above looks like. can see, button lower should be.

here css:

.searchbox { margin-top: 10px; width: auto; height: auto; float: left; margin-left: 35px; } .cf:before, .cf:after{ content:""; display:table; } .cf:after{ clear:both; } .cf{ zoom:1; } .form-wrapper input { width: 285px; height: 30px; padding: 10px 6px; border-radius: 3px 0 0 3px; background-color: #ededed; border: 1px solid #d9d9d9; color:#363636; } .form-wrapper input:focus { outline: 0; background: #e8e8e8; } .form-wrapper button { overflow: visible; position: relative; float: right; border: 0; cursor: pointer; height: 30px; width: 45px; color: #fff; background: #48a6d9; border-radius: 0 3px 3px 0; } .form-wrapper button:hover{ background: #4dafe3; border: 0; } .form-wrapper button:active { border: 0; }

and here how utilize button:

<div class="searchbox"> <form class="form-wrapper cf" action="" method="post"> <input type="text" name="username" placeholder="search user..." required> <button type="submit">go!</button> </form> </div>

how can prepare button should be? (beside input area)

thanks!

you need give float:left both (input , button)

i have created jsfiddle help you

css

notifications - Background service not starting android -



notifications - Background service not starting android -

i'm trying utilize background service can check new content on app every 30 minutes , notify user notification if there new content. problem that service not seem starting @ all. i'm not exclusively sure have wrong.

i've followed article implement notification service , question - trying start service on boot on android.

androidmanifest.xml

<uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.receive_boot_completed" /> <uses-permission android:name="android.permission.wake_lock" /> <uses-permission android:name="android.permission.access_network_state" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.____.mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <receiver android:name="com.____.bootreceiver"> <intent-filter> <action android:name="android.intent.action.boot_completed" /> </intent-filter> </receiver> <service android:name="com.____.notificationservice"/> </application>

the bootreceiver should start service

public class bootreceiver extends broadcastreceiver { @override public void onreceive(context context, intent intent) { intent startserviceintent = new intent(context, notificationservice.class); context.startservice(startserviceintent); } }

the service notificationservice right set display simple notification

public class notificationservice extends service { private wakelock mwakelock; /** * homecoming null, since our service not communicating * other components. work silently. */ @override public ibinder onbind(intent intent) { homecoming null; } /** * initialize. phone call when onstart/onstartcommand * called system. won't intent here, , * won't, either. */ private void handleintent(intent intent) { // obtain wake lock powermanager pm = (powermanager) getsystemservice(power_service); mwakelock = pm.newwakelock(powermanager.partial_wake_lock, "my app"); mwakelock.acquire(); // check global background info setting connectivitymanager cm = (connectivitymanager) getsystemservice(connectivity_service); if (cm.getactivenetworkinfo() == null) { stopself(); return; } // actual work, in separate thread new polltask().execute(); } private class polltask extends asynctask<void, void, void> { /** * work. there's nil me write here * have fill in. create http request(s) or whatever * have updates in here, because run in * separate thread */ @suppresslint("newapi") @override protected void doinbackground(void... params) { // stuff! // lastly added date time of offer // every 60 minutes check new offers notification notification = new notification.builder(getapplicationcontext()) .setcontenttext("new content available") .setsmallicon(r.drawable.ic_launcher) .setwhen(0) .build(); homecoming null; } /** * in here should interpret whatever fetched in doinbackground * , force notifications need status bar, using * notificationmanager. not cover here, go check docs on * notificationmanager. * * have phone call stopself() after you've pushed * notification(s). will: * 1) kill service doesn't waste precious resources * 2) phone call ondestroy() release wake lock, device * can go sleep 1 time again , save precious battery. */ @override protected void onpostexecute(void result) { // handle info stopself(); } } /** * deprecated, have implement if you're planning on * supporting devices api level lower 5 (android 2.0). */ @override public void onstart(intent intent, int startid) { handleintent(intent); } /** * called on 2.0+ (api level 5 or higher). returning * start_not_sticky tells scheme not restart service if * killed because of poor resource (memory/cpu) conditions. */ @override public int onstartcommand(intent intent, int flags, int startid) { handleintent(intent); homecoming start_not_sticky; } /** * in ondestroy() release our wake lock. ensures whenever * service stops (killed resources, stopself() called, etc.), wake * lock released. */ public void ondestroy() { super.ondestroy(); mwakelock.release(); } }

debugging app breakpoints in both bootrecevier , notificationservice never triggered. maybe i'm misunderstanding way background services work.

update

i found article why broadcastrecevier not beingness called. 1 of mentioned points pendingintent requestcode missing

i've updated bootrecevier follows test out service...called every 1 minute:

@override public void onreceive(context context, intent intent) { int minutes = 1; alarmmanager = (alarmmanager) context.getsystemservice(context.alarm_service); intent = new intent(context, notificationservice.class); pendingintent pi = pendingintent.getservice(context, 54321, i, 0); am.cancel(pi); if (minutes > 0) { am.setinexactrepeating(alarmmanager.elapsed_realtime_wakeup, systemclock.elapsedrealtime() + minutes*60*1000, minutes*60*1000, pi); } }

changing 0 'unique' requestcode 54321 somehow started triggering service. issue service not carry on working when app closed...not sure if that's different thing altogether.

update 2

i've updated doinbackground method in notificationservice, using example display notifications:

@suppresslint("newapi") @override protected void doinbackground(void... params) { context mcontext = getapplicationcontext(); // invoke default notification service notificationcompat.builder mbuilder = new notificationcompat.builder(mcontext); mbuilder.setcontenttitle("[notification title]"); mbuilder.setcontenttext("[notification text]"); mbuilder.setticker(mcontext.getstring(r.string.app_name)); mbuilder.setsmallicon(r.drawable.ic_launcher); intent resultintent = new intent(mcontext, mainactivity.class); taskstackbuilder stackbuilder = taskstackbuilder.create(mcontext); stackbuilder.addparentstack(mainactivity.class); stackbuilder.addnextintent(resultintent); pendingintent resultpendingintent = stackbuilder.getpendingintent(0, pendingintent.flag_one_shot); mbuilder.setcontentintent(resultpendingintent); notificationmanager mnotificationmanager = (notificationmanager) getsystemservice(context.notification_service); mnotificationmanager.notify(1, mbuilder.build()); homecoming null; }

i've tested on emulator , background service works when app closed. however, testing app on actual device did not display notifications.

you need declare permission receive intent in manifest.

androidmanifest.xml

<uses-permission android:name="android.permission.receive_boot_completed" />

http://developer.android.com/reference/android/manifest.permission.html#receive_boot_completed

you receive notifications of device booting after user has started application @ to the lowest degree once.

android notifications background-service

javascript - How to re-render directive with new template in Angularjs? -



javascript - How to re-render directive with new template in Angularjs? -

i'm doing simple web project, got issue angular directive. can not re-render html, render @ first time. code: http://plnkr.co/edit/jc9wnomrmlwabrdsoviu?p=preview

app.directive('dytemplate', ['$compile',function($compile) { var gettemplate = function(contenttype) { templatemap = { 1: '<div><a href="" ng-click="changetemplate(2)"> alter template 2</a></div>', 2: '<div><a href="" ng-click="changetemplate(3)"> alter template 3</a></div>', 3: '<div><a href="" ng-click="changetemplate(1)"> alter template 1</a></div>' }; homecoming templatemap[contenttype]; } homecoming { restrict: 'ea', link: function(scope, element, attrs) { // default load template element.html(gettemplate(1)); element.replacewith($compile(element.html())(scope)); scope.changetemplate = function(templateid) { element.html(gettemplate(templateid)); element.replacewith($compile(element.html())(scope)); } } } } ]);

you're using element.replacewith(), first time removes element dom, later calls doesn't alter dom, since element isn't in more.

i suspect you're overcomplicating things using $compile. in situations it's improve (because it's simpler) utilize template alternative in directive. angular handles compilation you. in template, can utilize {{}} interpolation, phone call functions, , alter what's beingness displayed using ngif if need to, compiled template, , there isn't need manually compiling or tinkering dom.

an illustration of can seen @ http://plnkr.co/edit/17empwulkfr904qti2oe?p=preview

var app = angular.module('myapp',[]); app.directive('dytemplate', function() { homecoming { restrict: 'ea', scope:{}, template: '<div><a href="" ng-click="shownexttemplate()"> alter template {{nexttemplateid()}}</a></div>', link: function(scope, element, attrs) { scope.templateid = 1; scope.nexttemplateid = function() { var templatemap = { 1: 2, 2: 3, 3: 1 }; homecoming templatemap[scope.templateid]; }; scope.shownexttemplate = function() { scope.templateid = scope.nexttemplateid(); }; } }; });

javascript angularjs

vbscript - VBS: How to use %PROGRAMFILES% in objFSO.CopyFile? -



vbscript - VBS: How to use %PROGRAMFILES% in objFSO.CopyFile? -

i trying re-create file objfso.copyfile command in vbs. problem is, can not utilize hard coded paths in company trying utilize variable. code, when utilize c:\program files\ instead of %programfiles% works.

option explicit dim strfiletocopy dim strfolder dim objfso dim objwshell set objfso=createobject("scripting.filesystemobject") set objwshell=wscript.createobject("wscript.shell") strfiletocopy = "%programfiles%\mainfolder\subfolder\netcfg.ini" strfolder = "%programfiles%\othermainfolder\" const overwriteexisting = true set objfso = createobject("scripting.filesystemobject") if objfso.folderexists(strfolder) objfso.copyfile strfiletocopy, strfolder, overwriteexisting else end if

use .expandenvironmentstrings():

>> set objwshell=wscript.createobject("wscript.shell") >> wscript.echo objwshell.expandenvironmentstrings("%programfiles%\mainfolder\subfolder\netcfg.ini") >> c:\program files\mainfolder\subfolder\netcfg.ini >>

vbscript

convert a matrix(list of lists) into a square matrix in python -



convert a matrix(list of lists) into a square matrix in python -

i want convert given matrices a, b square matrices inserting zeros wherever necessary

a = [[1,2],[3,4],[5,6],[7,8]] b = [[1,2,3,4],[5,6,7,8]]

i want output

a1 = [[1,2,0,0],[3,4,0,0],[5,6,0,0],[7,8,0,0]] b1 = [[1,2,3,4],[5,6,7,8][0,0,0,0],[0,0,0,0]]

i have problem installing numpy bundle on machine. solution without utilize of numpy help.

thanks

>>> = [[1,2], [3,4], [5,6], [7,8]] >>> b = [[1,2,3,4], [5,6,7,8]] >>> >>> def matrix(a, n): ... row in a: ... yield row + [0] * (n - len(row)) ... in range(len(a), n): ... yield [0] * n ... >>> list(matrix(a, 4)) [[1, 2, 0, 0], [3, 4, 0, 0], [5, 6, 0, 0], [7, 8, 0, 0]] >>> list(matrix(b, 4)) [[1, 2, 3, 4], [5, 6, 7, 8], [0, 0, 0, 0], [0, 0, 0, 0]]

python list matrix