Tuesday, 15 June 2010

php - Populate HTML table from MYSQL and counting rows -


I am trying to populate an HTML table with mysql data, I have the following data in MySQL: / P>

  id, ip, referral   

I want to create a table that shows a list of references and how often Is:

  ID, IP, referral 1 1.1.1.1 google.com 2 2.2.2.2 google.com 3 3.3.3.3 Test Comm 4 4.4.4.4 Other dot output:  
  google.com 2 test.com 1 another.com 1   

What I tried was:

  & lt; Table class = "table-table-barbed table-primary" & gt; & Lt; Tbody & gt; & Lt ;? Php $ sql = "select traffic from *"; $ Result = mysql_query ($ SQL); ? & Gt; & Lt ;? Php while ($ row = mysql_fetch_array ($ result)) {? & Gt; & Lt; Tr & gt; & Lt; Td square = "tc" & gt; Font face = "aerial, helvetica, non-serif" & gt; & Lt ;? Php if ($ row ['referal'] == '') {echo "blank referrals"; } Else {echo $ row ['referal']; } & Gt; & Lt; / Font & gt; & Lt; / TD & gt; & Lt; Td square = "tc" & gt; & Lt; Center & gt; & Lt; Font face = "aerial, helvetica, non-serif" & gt; & Lt ;? Php $ referal = $ row ['referal']; $ Sql ​​= "Select COUNT (*) traffic from WHERE referal = $ referal"; $ Num_rows = mysql_num_rows ($ result); Repeat "$ num_rows"; ? & Gt; & Lt; / Font & gt; & Lt; / Center & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt ;? Php}? & Gt; & Lt; / Tbody & gt; & Lt; / Table & gt;   

But it does not mention each person separately, as well as a new table row for each entry, even though the reunion was similar.

Any help is too big to appreciate.

You might be searching for keyword for GROUP BY SQL: < From the Traffic Group, from the / p>

  referral,   

, select COUNT (*), it will give you the exact table without any additional loop for you Want php

Display ellipse in matlab -


I want to write the code to display the first square and then write two or two oval orthogonal inside the square box. Want to Please help me. I am new to Matlab I know all the basics of matlab.

The following code should work:

 (0, 0, 0.5, 1 , 0)% Attract the first alpi with the center (0,0) epderect ([-1 -1 -1]]% parameter [xMin xMax yMin yMax]   

Drawing you And you should read the document on the oval drawing:

If you work there, then what parameters do you take, and then you can change the parameters according to your needs.

debugging - how does debugger resume from breakpoint? -


Consider setting a software breakpoint for the virtual address such as the debugger (normal x86 ring3 debugger such as Oli, IDA, GDB ...)

< P> 0x1234

This is done from 0x1234 to 0xCC, which has been completed by replacing the opcode. Now we believe that the debugee process runs this 0xcc instructions and the software raises an exception and the debugger catches it.

Debugger inspects the memory contents, registers and does some stuff .. And now it wants to resume the lean process.

It is as far as I know.

Debugger connects the debugger's EIP to the DUDI's contact point to the recovered instruction.

The debugger handles the exception and now, the debews starts with the breakpoint.

But the debugger breakpoints wants to stay and how can Debugger manage this?

To answer the original question directly:

When user To continue, GDB will restore the original instruction, the single-phase will rejoin the trap, and will continue.

Jquery animate duration: movement not smooth enought -


This is the time I am writing here. I have some problems with JQuery Chetan: When the period is really slow (for example, 10000), movements are not easy. I need a "natural" movement for my div. Does anyone know the solution to my problem? Or can you give me advice on what to do? Thanks !!!! Code is something like: prefix function moveFoo () {var timeFoo = setInterval (function () {var $ foo = $ ("# foo"); $ foo.animate ({"top" : "- = 10px"}, 20000, "linear"); $ foo.animate ({"top": "+ = 10px"}, 20000, "linear");}, 1); }; MoveFoo ();

You should look at the requestanimationframe and / or use a twing engine which is requestanimationframe's Uses Timer based animations that are used in the jQuery Towing Engine, they are not efficient and timers are due to incompatible animation.



VB.NET and IBMi SQL dr.hasrows isn't showing rows (that I know exist) -


The

I'm running into a problem where I use a dr.hasrows IF statement, and it's wrong Returning to form (when I am 100% positive, this is true). I am very new to both VB and IBM (SQL), but I have done the work of this order in the past.

  private sub btnAdd_Click (ByVal string as the System.Object, ByVal System.EventArgs e) btnAdd.Click dim SQL handles = "* from testlib.hrcontra select where @ HRAART = HRAART and @ HRASEC = HRASEC and @ HRAPAR = HRAPAR and @ HRASEQ = HRASEQ and @ HRARED = HRARED "such as the use of new cmd iDB2Command (SQL, CN) cmd.DeriveParameters () cmd.Parameters ( "@HRAART"). Value = SCRHRAART cmd.Parameters ("@HRASEC"). Value = SCRHRASEC cmd.Parameters ("@HRAPAR") Value = SCRHRAPAR cmd.Parameters ("@ HRASEQ"). Value = SCRHRASEQ 'cmd.Parameters ("@HRARED") Value while = SCRHRARED (as iDB2DataReader = cmd.ExecuteReader dr.Read Using Dr.) If dr.HasRows = truth exists MsgBox (try "list first!") Exit end before catching sub-end , so as iDB2Exception Form1.HandleError, East) try to end out of sub-end exit (using "cmd.ExecuteReader (an error has occurred on)"   

what Do I need to use all the fields (even non-keys)? Or, why I can use the 4 key areas in this case (that goal). I solution is to try to work both SQL and VB.net angles and did not find it anywhere. < / Div>

Holly caps, you have re-examined me the SQL and realized that I was comparing HRRAD in my SQL I removed it from the SQL command and now it works!

Thanks, Steve!

Solution: Make sure your SQL and VB matches, children check again!

networking - validation in p2p communication -


Let's say that in each of my "networks" of users, each node can only create a hashed code (generated from the ID of the node).

Now, the node sends a node B. This hash code. The node is no longer a boss, but b is still a string, so node decides to invoice a system and sends the same code to node. How does the node know that A has done an illegal operation?

Can you validate operation only after communicating with node? (Communication with the server or other nodes)

thanks

I think That's your question:

How can I prevent node id theft / forgery in a P2P overlay network?

The answer is:

Use of public key cryptography.

Read Specific line and ignore others using python -


मेरे पास एक पाठ फ़ाइल है:

  इनपुट फ़ाइल yuorvsdsd dfdsfsd? Dsfsdfsd sdfsdfs? Dfd ds   

मैं इसे बनाने की कोशिश कर रहा हूँ ताकि यह केवल पढ़ता हो ? पटकथाएं फ़ंक्शन सभी पंक्तियों को पढ़ता है, इसलिए मैंने उस पर एक शर्त डाल दी है, लेकिन मैं इससे संतुष्ट नहीं हूं, क्योंकि यह मुझे सटीक परिणाम नहीं दिखा रहा है मुझे आउटपुट होना चाहिए:

 ? Dsfsdfsd? Dfd   

प्रोग्राम

  fp = खुले ("file.txt") z = fp.readlines यदि z == '?': Print z fp.close ()   

यह वह कोड है जिसे मैंने कोशिश की

मैं निम्नलिखित की तरह कुछ का उपयोग करेगा:

  खुले ( "File.txt") के रूप में fp: line में fp: if line.startswith ('?'): प्रिंट लाइन   

एक संदर्भ प्रबंधक ( के साथ ... जैसा कि ) फ़ाइल के समापन के बाद स्वचालित रूप से आपके साथ किया जाएगा।

garbage collection - Will Java's interned strings be GCed? -


While tracing a potential memory leak, I came to the following incident. Is Java 7 not accurate to internal string or JMAP?

 # jmap -heap 9724 | Grep interned ID 9724 Attached to the process, please wait ... The server has been successfully connected JMM version 23.3-B01 10526 internal strings are captured 880048 bytes. #Jmap -heap 9724 | Grep interned ID 9724 Enclosed to process, please wait ... The server has been successfully linked to the server compiler JMM version 23.3-B 101 10514 are the internation strings on which 878984 bytes are. #Jmap -heap 9724 | Grep interned id 9724 Enclosed to process, please wait ... The server has compiled successfully the debugger JMM version 23.3-B 101 1059 internal strings are 879720 bytes.  

Environment: Linux version 2.6.32-220.23.1.el6.centos.plus.x86_64 (mockbuild@c6b5.bsys.dev.centos.org) (GCC version 4.4.6 20110731 (Red Hat 4.4 .6-3) (GCC)) # 1 SMP Tuesday, June 19 04:14:37 BST 2012

Java version "1.7.0_07" Java (TM) SE Runtime Environment (Build 1.7.0_07-B 10) Java HotSpot (TM) 64-bit server VM (23.3-B01, creation of mixed mode)

Yes the internal string is retrieved. And as mentioned in this it is proposed:

In JDK 7, the interned strings are no longer allocated in the permanent generation of Java stacks, rather its main parts Are allocated in Java pile (known as young and old generations), along with other items made by the application. As a result of this change, there will be less data in the main java stack and lesser figures in permanent generation, and thus the size of the pile may be required to adjust. Due to this change, only relatively small differences will appear in Hep Usage in most applications, but large applications that load multiple classes or use the String.intern () method heavier, they will see a more significant difference.

asp.net - Send File to Client from UserControl behind UpdatePanel -


I have user controls on the ASP.Net page (which is using the master page) inside an UpdatePanel There are many functions in which the buttons are included, the control works fine except for a link, where I am trying to send a file to the client while clicking on it.

Control is instant with an object whose performance, action, and optionally ordered to transmit the client. I have previously sent files in this project but before a UserControl, and not behind UpdatePanel, the browser acts like this, like I'm not clicking on the link, even if I can move through the code and I know that this is working.

  Response.Clear () Response.AppendHeader ("Content-Properties", "Attachment; File Name = Assignment."). Contact type = "text / xml" 'serialization code' is given here. reaction. Write (seralizedObject) Response.Flush () Response.End ()   

I have tried feedback Turn off Instead, I tried to use the response.optputstream.light . Nothing seems to be working. Am I trying to do as well? Or do I need to prepare some ways to redirect to another page, which will then send the file?

UPDATE: In view of the reply received, I change this implementation to another URL (an ASHX file) to actually send the file, but this is not ideal. I am still open to other suggestions on this.

If any UpdatePanel does not work, I still want to send the 'intrinsically' object to another file (like an ash file) that can send the file Was just using the url query to send enough information to rebuild the object in my ohsex file. Needless to say, this is not a very beautiful solution.

You can not stream a file for customers with an updated panel for various reasons. File streaming does not work in this AJAX scenario. Try to remove UpdatePanel and it works without it, and then use it. for more information.

jquery - Why is event.namespace undefined for click event? -


इसे देखते हुए:

HTML

 < कोड> & lt; बटन आईडी = "बीटीएन" & gt; मुझे क्लिक करें & lt; / button & gt; & Lt; br / & gt; & Lt; div id = "परिणाम" & gt; & lt; / div & gt; ("Click.mynamespace", फ़ंक्शन (e) {/ code>  

JS

  $ ("# बीटीएन")। $ ("# परिणाम")। पाठ ("नाम स्थान:" + e.namespace);});   

नामस्थान हमेशा अपरिभाषित क्यों है?

एडीट:

मैं क्या करने में सक्षम होना चाहता हूं एक ईवेंट हैंडलर के एक बटन क्लिक ईवेंट पर कई उदाहरण जुड़ा हुआ है। तब, जब बटन क्लिक किया जाता है, तो प्रत्येक उदाहरण को, बारी में कहा जाता है ईवेंट हैंडलर के प्रत्येक उदाहरण को स्वयं को डिस्कनेक्ट करने की आवश्यकता होती है, इसलिए यदि बटन को फिर से क्लिक किया जाता है, तो वह हैंडलर उदाहरण नहीं कहा जाता है।

नामस्थान संपत्ति को केवल तभी परिभाषित किया जाता है यदि jQuery के .trigger या .triggerHandler विधियों का उपयोग करके ईवेंट को चालू किया गया था। अन्यथा, कैसे jQuery के नाम का उपयोग करने के लिए पता होगा अगर वहाँ एकाधिक थे?

यदि आपका लक्ष्य केवल एक बार होता है, तो विधि अधिक उपयुक्त होगा।

What is the difference between these facebook access tokens? -


I am developing an FB application which can manage pages but I need to make it clear:

What

$ page_info = $ facebook-> The difference between the API ("/ $ page_id? Fields = access_token");

and

$ aToken = $ facebook-> GetAccessToken ();

I think they generate different tokens, but I am unsure about how I should store the database for offline posting, and what each does?

Thank you ..

retrieves a page access token:

  • You use it to work on behalf of the page

    Other (by default in PHP SDK):

      < Li> The user used to perform actions on behalf of the user retrieves access tokens. The main difference here is that in order to obtain a token using a page, you must request permission from the user to manage_pages .

asp.net mvc - Automating Azure VIP Swap -


I have the ASP.NET MVC 4 app that is hosted as a blue web role. I want to do something that seems like it should be very standard: I want to create a function that I swap VIP during the VIP swap operation and can start an event (or callback) .

To add some context to just the situation: My website applies a workflow that takes about an hour (or less) to complete. If I want to release a new version of the website code, first to make it available to all existing users to complete the workflow first (this is to write a very few "backward compatibility" code), so that no need to deal with the new code Ho. Data created by the previous version of the code, so a management function on my website first hits a value in the database which disables new workflows; It will wait till all the current workflow is completed; This will call the "VIP swap" routine; Finally, when the VIP swap routine indicates its completion, it will suppress the database value to re-enable new workflows.

I have received Microsoft documentation on how to program a VIP swap:

This process involves posting a magic URL and some headers are included in the post, then From time to time, a GET is examining a magic URL and response code.

As much as I think about it, the more non-trivial it seems, in addition to the basic timepieces of a background timer and complete notification, I do not know what the complications are, if any, So I can try to do this stuff in the IIS environment. Can I do the HTMH operation on the background thread? For that matter, will I run into complications, which is cooked in half a dozen or any different "working in the background" NAT?

Any help or guidance will be greatly appreciated. Specifically, I'm excited if someone can tell me in the ready-made implementation of this function!

I do not think you will find an easy solution because the clothing controller Ready to do some great work without running an hour-long workflow in the cloud computing environment, where an example can be pulled from under you (called for cleaning up onstoping with maximum 5 minutes Going) is that you hear it Other work to Shcit that was completed all your tasks.

The simple question is, "If the workflows are still going on, then an example goes down?" Do you restart them or do they lose? If they are lost then you do not care in any way, so killing the workflow for the upgrade is equally unimportant. If you start them again, use a single mechanism for determining that a node is closed and distribute the work accordingly. This pattern is eerily similar in form. Do not run the workflow on just any 'OL example' Submit them for a job tracker service that decides what to do. (Job Tracker) service can then use the Service Management API so that you can increase the number of versions, as you want the version to run, run a workflow on the appropriate node, and turn them off when they are now Not necessarily or old.

Unfortunately, this is not a simple solution for you, but instead of trying to fit the loop with your current perspective, some changes need to be made in your architecture. Reduce your workloads, create loose coupling services, design for failure, and some other cloud / distributed computing practices should be considered. One reason that Hadoop is built in the way is that ??? And in this there is a reputation for being able to work on some unreliable items on a bunch of hardware.

Android Seekbar float values from 0.0 to 2.0 -


how to seekbar i have a with 2.0 to 0.0 ???? One ???? Can a value get ? Can anyone help me in the steps of 0.5 (0.0, 0.5, 1.0, 1.5, 2.0)?

SeekBar extends ProgressBar

ProgressBar is a method

  Public Zero setMax (integer max)   

Since it only ac ac accepts you will have to To get some conversion float from an integer value that you are after

you should do the trick like this:

  mSeekBar.setMax (4); // maximum = 4 so that potential values ​​are 0,1,2,3,4 seekbar.setOnSeekBarChangeListener (New OnSeekBarChangeListener) {Public Zero onProgressChanged (seekbar seekbar, integer progression, boolean fromUser) {// TODO Automatic built stub toast .makeText (seekBar.getContext (), "value:" + getConvertedValue (progress), toast.LENGTH_SHORT) .show ();} Public Zero onStartTrackingTouch (seekbar seekbar) {// TODO auto-created method stub} Public Zero onStopTrackingTouch ( SeekBar seekBar) {// TODO auto generated method stub}});   

This part will be in your creation () and you will have to use FindViewById () or something to get the MSEkabar reference.

  The converted value of the public float (int integral) {float float value = 0.0; FloatVal = .5f * intVal; Return flat val; }   

This is another way that you can add to your activity that will replace the values ​​with float within the required range.

How to change action of Ship button to own Module/controller/action in Magento admin order view screen? -


Magento व्यवस्थापक

मैं Magento बैकएंड में ऑर्डर व्यू स्क्रीन में शिप बटन की कार्रवाई कैसे बदल सकता हूँ? उपरोक्त छवि शिप बटन का अर्थ है I मैं इसे अपने स्वयं के नियंत्रक / अपने स्वयं के मॉड्यूल की ओर इशारा करना चाहता हूं। मैं अपने मॉड्यूल को तोड़ने के बिना Magento को अपग्रेड करने के लिए संभव के रूप में यह करना चाहता हूं।

बनाने का प्रयास करें एक कस्टम मॉड्यूल जो Mage_Adminhtml_Block_Sales_Order_View

config.xml:

  और & lt; ग्लोबल & gt; & LT; ब्लॉक & gt; & LT; adminhtml & gt; & LT; पुनर्लेखन & gt; & LT; sales_order_view & gt; Namespace_Module_Block_Adminhtml_Sales_Order_View & lt; / sales_order_view & gt; & Lt; / पुनर्लेखन & gt; & Lt; / adminhtml & gt; & Lt; / ब्लॉक & gt; & Lt; / वैश्विक & gt;   

नेमस्पेस / मॉड्यूल / ब्लॉक / एडमिन एचटीएमएल / सेल्स / ऑर्डर / व्यू। पीएचपी:

  क्लास नेमस्पेस_मॉडलब्लॉक_अडमिनहैम_साल्हे_ऑर्डर_व्वेज मेज_एडमिनएचएमएलब्लॉक_केल__एस_ऑर्डर_दृश्य {सार्वजनिक फ़ंक्शन getShipUrl () {// अपना कस्टम यूआरएल वापसी $ this- & gt; getUrl ('* / sales_order_shipment / start') जोड़ें; }}   

देखें /app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php

और पढ़ें @

यदि आप शीर्षक अपडेट भी बदलना चाहते हैं तो

  यदि ($ this- & gt; _isAllowedAction ('ship') & amp; amp; $ order- & gt; canShip () & amp; amp; $! $ ऑर्डर- & gt; getForcedDoShipmentWithInvoice ()) {$ this- & gt; _addButton ('order_ship', सरणी ('लेबल' = & gt; मेगा :: सहायक ('बिक्री') - & gt; __ ('जहाज'), 'ऑनक्लिक' = & Gt; 'सेट' स्थान (\ ''। $ This- & gt; getShipUrl ()। '\') ',' Class '= & gt;' जाओ ')); }    

powershell - Why doesn't psake evaluate my property the way I expect? -


मेरे पास एक सरल स्क्रिप्ट स्क्रिप्ट है:

  properties {$ SolutionDir = "SOLUTIONDIR" # रिज़ॉल-पाथ "। \ Src" $ config = "debug" $ DeployBaseDir = "$ SolutionDir \ RMSS.Setup.WiX \ bin \ $ Config" $ InstallerName = "RMSForMoversSuite_2_0_0"} कार्य डिफ़ॉल्ट -निर्धारित परीक्षण टेस्ट {"CONFIG = $ Config "" SolutioNDIR = $ SolutionDir "" DEPLOYBASEDIR = $ DeployBaseDir "}   

और मैं इसे इस तरह से कमांड लाइन से कॉल कर रहा हूं:

& amp; ; । \ Psake.ps1। \ Deploy.ps1 -properties @ {"Config" = "Staging"}

मुझे उम्मीद है कि $ DeployBaseDir के बराबर होगा < कोड> समाधान> RMSS.Setup.WiX \ bin \ Staging

लेकिन इसके बजाय, मुझे यह आउटपुट प्राप्त होता है:

  CONFIG = स्टेजिंग समाधान = SOLUTIONDIR DEPLOYBASEDIR = क्या कोई मुझे बता सकता है कि क्या हो रहा है, क्यों, और मैं कैसे उम्मीद करता हूं कि व्यवहार कैसे करें?   

>

यहां से

पैरामीटर और गुणों के लिए समर्थन

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

  invoke-psake Deploy.ps1 -parameters @ {server = '' Server01 ???}} # Deploy.ps1 प्रॉपर्टीज {$ serverToDeployTo = $ server} कार्य डिफ़ॉल्ट -नहीं   

पैरामीटर महत्वपूर्ण हैं जब आपको जानकारी की आवश्यकता होती है दूसरी ओर गुण डिफ़ॉल्ट मान को ओवरराइड करने के लिए उपयोग किया जाता है।

  invoke-psake Build.ps1 -properties @ {config = 'release'} # Build.ps1 गुणधर्म {$ config = 'debug' } कार्य डिफ़ॉल्ट - सभी   

निर्भर करता है तो आप या तो गुणों में से $ Config ले सकते हैं और इसे पैरामीटर के रूप में पास कर सकते हैं।
या $ DeployBaseDir को संपत्तियों और इसे कार्य ब्लॉक के अंदर बनाते हैं

Including a function within an R script -


I hope there is a script that I can paste in R at the same time. Ideally this script has lines of code with different functions. But as of now, I have to paste the bits of my code in a one-time-one, because (as I've written) the function will not work when it runs at the same time with the code given below Will go

For the code given below, I have to keep the user input initial data, and then run the calculation on it. Since I can not run many "redline" calls in one line, so I wrapped them in a function called Define. But the following code will not work if I paste it in R at a time.

  define & lt; -function () {N & lt; -readline ("EnterDeployment #") Y & lt; -a.numeric (name ("list" = y, "name" = n, "length" = "," "line" l))} def <-Define () name & lt; -Def $ name Year & lt; -Def $ Years L & lt; -Def $ Length Readline (Paste ("UPDN =", name, "year =", year, "distance =", l, "If this is a correct press return") SP = "")) D & lt; -L / 4F & lt; -D * 5   

But if I break it into segments, it works just fine. Is there any way to include one or more functions in a row?

I have no reason The function does not even have other steps, it will solve the problem and it will be due to the formation of the IMHO.

  FOO & lt; - function () {define & lt; -function () {N & lt; -readline ("EnterDeployment #") Y & lt; -s numeric ("(Which year was deployment?")) L.L.L.; -A.Nemmic (readline ("What is the distance?" ) The name ("year" = y, "name" = n, "length" = l)} def <-Define () name & lt; -Def $ name year & lt; -Def $ years l & lt ; -Def $ length line (line paste ("UPDN =", name, "year =", year, "d Pre = ", l," if this is the correct press returns ", SP =" ")) D & lt; -L / 4F & LT; -D * 5 list (D = D, F = F)}   

We have access to:

  & gt; FOO () EnterDeployment # 12 What was the deployment? 2012 What is the distance? 54 UPDN = 12 years = 2012 distance = 54 If this is correct press return $ D [1] 13.5 $ F [1] 67.5   

Of course, you will need a source < / Code> . is in the file FOO () , but this is not a problem.

Why is this better? It is okay to organize all the steps involved in any such ceremony. You also do not pollute things made as intermediate steps. Finally, if other users have to pass it, you can package it as R package (you do not have to type the document - just add a bare bones .rd file).

ios - Segmented Control with ViewControllers MFMailComposer rotation issue -


I have a View Controller that has a Segment Control.

Your view controller next to each divided control. Technically, I start the View Controller for each segmented control and display it to display the view, and hide other views.

All this works well, but now I am trying to display an MF filamel composer with current model VIPU controller. I need to explicitly do this on ViewController where the Segmented Control is on it, because with other view controllers I have just put the view above the volume control.

The MFmail composer appears and disappears, but after disappearing altogether the app rotated 180 degrees. I only support one orientation, 180 degree rotation is not supported by the flint.

What did I do?

The problem was the function: In my TabBar controller preferredInterfaceOrientationForPresentation I now It has been removed and now it is fixed.

symfony 1.4 - Propel multiple-parameter binding in where() clause -


I'm trying to run this question with 1.6 Symphony 1.4.20.

I want to force 2 parameters on this subquery, but it is not working.

  $ pages = PaginaQuery :: create () - & gt; Where (choose the "clienti_artista Cliente_id =? And cliente_artista.culture =?)", (Array '(' XXX ',' n ')) -> in pagina.id (select "clienti_artista"); Range (5) - & gt; Search ();   

This gives me an error:

  can not determine the column to bind the parameters in the section   

I also found this post but there is no answer ()

instead of using placeholder You can use the $ ID and $ culture:

  // First, get an array of IDs // Define your wars $ id = $ your_id_param; $ Culture = 'n'; $ Cliente_artistas = ClienteArtistaQuery :: create () - & gt; Select ('id') - & gt; Different () - & gt; FilterB-Client id ($ id) - & gt; FilterBeculture ($ culture) - & gt; Search (); $ Paginas = PaginaQuery :: create () - & gt; Where ("Page No. What?", $ Cliente_artistas) - & gt; Range (5) - & gt; Search ();   

If this is to be done in a query, then recommend using the raw SQL in the PDO statement and binding the parameter (but then you lose the chance of PropelObjectCollections):

  public function getResultSet ($ id, $ culture) {$ id = $ id_param; $ Culture = $ culture_param; $ Sql ​​= & amp; Lt; & Lt; & Lt; ENDSQL SELECT * is not on page WHERE ID (Select different ID from client WHERE cliente_id =? And culture =?) LIMIT 5 ENDSQL; $ Connection = Propell :: Mill Connection (); $ Statement = $ connection-> Prepare ($ sql); $ Statement- & gt; Bind value (1, $ id); $ Statement- & gt; Bind value (2, $ culture); $ Statement & gt; Executed (); $ Resultset = $ statement- & gt; Get All (PDO :: FETCH_ASSOC); // Or whatever you need (count! ($ Resultset)> = 1) {// Brace the empty resultset} returnities $ returnet; }   

You can also type some query methods to use. Of course, this is a beneficial reference. There are several ways to do this. I have indicated a method here that should work for you.

Edit: There is an idea to do this as a query [Because the utility usage () requires the name 'relationship'), it considers the idea The tables are not related but these are the IDs:

  $ page = PageGrange :: :: () -> addJoin (Pagesieri :: ID, Client Ersteopsy :: CLIENTE_ID, criteria :: LEFT_JOIN) - & gt; Where ("Clint Artist.ID <", $ Id) - & gt; Where ("Clint Artist.Silkat <<", $ culture) - & gt; Select (Arrays ('Your', 'Page', 'Column', 'Array')) - & gt; Range (5) - & gt; Search ();    

javascript - How to make shorcuts on the current directory of a usb drive using vbscript? -


I'm new to coding, and today my purpose is to create a shortcut on the current directory of a USB thumb / flash drive i script Has made some progress, but I'm having problems setting up the target path for the shortcut, because when a plug-in is plugged into a computer to a USB flash drive, they should be automatically assigned the drive letter Security is so shortcuts target path every time is different I do not know that I will how it works. It will be highly appreciated if you guys help me with this one, thanks!
  set to OWS = WScript.CreateObject ("WScript.Shell") sLinkFile = "A.lnk" set ollink = OWS.CreateShortcut (sLinkFile) oLink.TargetPath = "(What is the USB drive letter Should be): \ A.vbs "'Ollink Arguments = "" Ollink. " Description = "MyProgram" 'Olink.Icon Location =' C: \ Xxx \ notporno "'Ollink. Window Style =" 1 "ollink. Save    

A ?? Forsajt

thanks forsajt You actually helped me with this one, here is a part of my solution:

  set strLinkFile = "A.lnk" fso = CreateObject ("Scripting.FileSystemObject") Set oWS = WScript.CreateObject ("WScript.Shell") Set Olink = OWS GameSearch The stroke (strLinkFile) strPath = oWS.CurrentDirectory if fso.FileExists (strPath and "\ Target.file"), then the Ollink target.php = straps & "\ Target.file" ollink. Save & if    

Simple HTTP Server in C - How to response to Browser? -


My server is sending sample feedback headers to the body for a request:

  Fixed letters \ n "" & html; Gt; \ N "" & lt; Body & gt; \ N "" & lt; H1 & gt; No, \ n "" \ n "" Type of content: text / html \ n "" \ n "" & lt; Html & gt; \ N "" & lt; Body & gt;  \ n "" & lt; / Body & gt; Send it correctly (but not until I cancel the transfer) Firefox loading.  

The Firefox plugin HttpRequestHelper shows this:

Obtain the local host: 6666

- Feedback - 404 Not Found Content-Type: Text / html

Why the content has not been loaded?

After sending Ia try to flush the socket and / or off.

Validate Maven archetype properties -


Is there any way to validate Maven originally given properties? If so how?

I have a custom required property that is in my metadata.xml file. Values ​​should match a certain regular expression and I would like to validate during that origin: Generation

i implemented this feature in maven-archetype and it is presented as a bridge request :



delphi - How to make a form align to the edge of the screen like the taskbar? -


I am creating a "dashboard" application that looks always with any side of any monitor, even if Only other applications max. I do not necessarily need "always at the top" (though I will) but I need to make it a part of the screen as my desktop toolbar like Windows Taskbar even when maximizing applications , The windows are within this area, so this window is always visible (and small in the desktop area).

How can I align the main form of my application on the edge of a screen?

PS - I do not need to answer all the extra gritty responses, as the screen resolution changes ... I need to know how to combine it as part of the screen ? In the first place.

You see, that uses the Windows Task Bar internally with a specific style in it Creating a window involves setting it up correctly, and then communicating with it.

This can be very complicated, but with the source some free components are available (one or the other) that are the original shell to get you started.

An example from the AppBar.pas unit of another link (which, according to the link text, is freeware with the source - I used it to create an app launcher Bar, application icon and full button with details to read from .lnk files):

  type TAppBarMessage = (abmNew, abmRemove, abmQueryPos, abmSetPos, abmGetState, AbmGetTaskBarPos, AbmActivate, abmGetAutoHideBar, abmSetAutoHideBar, abmWindowPosChanged); TAppBarEdge = (abeLeft, abeTop, abeRight, abeBottom, abeUnknown, abeFloat); ... function TAppBar.AppBarMessage (abMessage: TAppBarMessage; abEdge: TAppBarEdge; lParam: LPARAM; bRect: boolean; var rc: TRect): UINT; Var abd: TAppBarData; Get started // start apt cadet structure abd.cbSize: = sizeof (abd); Abd.hWnd: = Handle; Abd.u callback message: = WM_APPBARNOTIFY; Abd.uEdge: = Ord (abEdge); If bRect then abd.rc: = rc abd.rc: = rect (0, 0, 0, 0); Abd.lParam: = lParam; Results: = SHAppBarMessage (Ord (abMessage), abd); // If the caller has passed a rectangle, then redo the revised rectangle again, then RC: = abd.rc; End;    

java - Genereating Random Number method -


I need help writing a method that will return a random 4 digit number with no duplication. I'm not allowed to use the string anyhow ...

This is what I have done so far and the row I ran into is getting an error. I ran: solve Can not be done

  public static int generateSecretNumber () {random R = new random (); Int x = r.nextInt (1000) ;; X = x + 1000; Return x;    

line:

  int x = + ran .nextInt (1000);   

should read

  int x = r.nextInt (1000);   

One more thing - you say that you want to generate a random 4 digit number with no repetition. It can take a while because it is perfect for a random number generator, to return the same number several times, in the same way when you flip a coin, you can get 4 heads in a row.

python - Django wildcard query -


मेरे पास मेरे आवेदन में निम्न तर्क है:

  प्रदाता = request.POST.get ('प्रदाता', '*')) order_items = OrderItem.objects.filter (प्रदाता = प्रदाता)   

क्या मैं एक डीजेंजो में उपयोग कर सकते हैं वाइल्डकार्ड, ऐसा कोई प्रदाता अगर पोस्ट अनुरोध, यह उसके लिए सभी वस्तुओं को वापस करेगा?

दूसरे शब्दों में, क्या यह पूरा करने का एक तरीका है?

  अगर अनुरोध .POST.get ('प्रदाता'): order_items = OrderItem.objects.filter (प्रदाता = प्रदाता) अन्य: order_items = OrderItem.objects.all ()    

कोई प्रत्यक्ष वाइल्डकार्ड पैरामीटर नहीं है, इसलिए आपके पास पूरी तरह स्वीकार्य है। कोड पठनीयता भी गिना जाता है, भले ही आप अधिक कोड के साथ समाप्त हो जाएं, हो सकता है कि यह अधिक संतोषजनक हो।

आप इस तरह की खोज की श्रृंखला को चेन कर सकते हैं:

  प्रदाता = अनुरोध .POST.get ('प्रदाता') order_items = OrderItem.objects.all () यदि प्रदाता कोई नहीं है: order_items = order_items.filter (प्रदाता = प्रदाता)   

या आप सेट कर सकते हैं kwargs के लिए फ़िल्टर () इस तरह कॉल करें, लेकिन यह मेरी राय में कम पठनीय है:

  प्रदाता = अनुरोध POST.get ('प्रदाता') kwargs = {} अगर प्रदाता कोई नहीं है: kwargs ['प्रदाता'] = प्रदाता के order_items = OrderItem.objects.filter (** kwargs)   

यह इस तरह से फ़ंक्शन कॉल में परिवर्तित किया जा सकता है:

  def all_or_filter_args (अनुरोध, आइटम): "" "फिल्टर के लिए तर्कों का शब्दकोश लौटें" यदि आइटम अनुरोध में निर्दिष्ट किया गया है। "" " = Request.get (आइटम) अगर मान नहीं है: रिटर्न {} रिटर्न {मद: value}   

और फिर निम्न एक-लाइनर के लिए उपयोग किया जाता है प्रश्न:

  order_items = OrderItem.objects.filter (** all_or_filter_args (अनुरोध, 'प्रदाता'))   

लेकिन फिर से, मुझे नहीं पता यह आपके द्वारा दिए गए उदाहरण के रूप में पठनीय है।

एक अन्य तरीका लिखना है जो आपको फ़िल्टर करने के लिए अपने स्वयं के कार्यों का उपयोग करने की अनुमति देता है। कस्टम मैनेजर के साथ आप इस तरह से प्रश्नों को अनुमति देने के लिए कोड लागू कर सकते हैं, जहां आप सही फिल्टरिंग लागू करने के लिए all_or_filtered के लिए फ़ंक्शन प्रदान करते हैं:

  order_items = OrderItem.objects All_or_filtered ('प्रदाता', अनुरोध। POST.get ('प्रदाता'))    

jquery - Dynamically rotate image according to distance from mouse -


I have an image, and want to rotate it, however, I do not think the CSS keyframe will work because they are dynamic form Can not change from I am currently using a jquery plugin on jquery rotate what I want to do, changes the rotation speed from element to mouse. Is there any solution that is not very intensive (hopefully) CPU, because the JQR rotate is already very useless of CPU power. Here's my code:

  var angle = 0; Var distance = 200; Set interval (function () {plus = distance / 100; angle = = plus; $ ("# AMM"). Rotate (angle);}, 25);   

See the JSfield that rotates the image to 2 degrees each loop. What I would like to do, increases the speed of rotation as the mouse passes (by changing the "distance" variable).

Edit: Bella has been updated here:


MouseX & amp; Y in the body with the body. PageX & amp; Y is your image offset address using element.offset ()

  $ (document) .ready (function () {$ ('body'). Mousemove (function (e) {/ / Was to put an image in the coating box because it was rotating var offset = $ ('# container') offset (); var distance x = e. Pagex - (offset.left + ($ ('# amm'). () / 2)); var range Y = E. Gageo - (offset.top + ($ ('# ames'). Altitude () / 2));}    

java - An "Empty" Character Extracted from a PDF -


I recently tried to use PDF to extract text from a PDF file. This works well for most PDFs, but for a PDF (which is unfortunately not allowed to share me), all the periods of sentences are not taken out. Instead, I get phrases like the following:

  ... what will this happen ... it will be important later ...   

It seems that this is just a place rather than a space, but it is not (at least on Mac OS X) if you copy the text into a text editor and begin to move the text cursor through the phrase , Then there is a "blank letter" immediately after "T" in "foot" To various:

  • Keep preceding cursor "feet" in the letter "T" and press the right arrow key. The cursor moves one step to the right.
  • Press the right arrow key again, you are right where you are.
  • Press the right arrow key one more time, you can see the other side of the space.
  • Exits as expected to continue by pressing the right arrow key

    It appears that the PDF box has some kind of "blank character" Removed period I have tried to change it in a few different ways, but I have not found any luck:

      string old text = text; Text = text.replace ('\ u0000', '.'); // Unicode tap text = text Location ('' 0 ','. '); // C System System.out.println (oldText.equals (text)); // Returns True // Also tried the text Location (zero, '.'), But it does not compile   

    What is this "empty character" and how can I change it?

    Edit: It has been suggested that the character can be a letter like \ uFEFF , but it is not suggested to try to replace it with a rijks < / P>

    After feeling that the character \ uFEFF or \ u0000 , two values ​​of Unicode which used to run other stack overflow users, I decided to run a test to decide what the code was really about. Using the code to determine what the Unicode value is, I discovered that the mysterious character was \ u008 , which is "". Why was I not known from PDF, I did not know, but text = text.replace ('\ u0008', '.') now it changes with missing time.

loops - Trying to get Pascal to read from file then add all of the even numbers having issues. -


OK, I'm trying Pascal to read a set of integers from an input file, even then Take and add them together is not working for me in the category of 1-50. Here's what I have: List of input file numbers 1 2 3 4 5 6 7 8 9 11 12 64 13 14 15 16 71 33 34 35 36 41 44 46 82 512 49 50 and my Pascal program:

  Programs (input, output, indet); Uses Crt; War indenta: lesson; Number, even: integer; Start clrscr; Assign (indenta, 'j: \ num.txt'); Reset (indata) 0; Read (indet, number); While the points> 50 start reading (indet, number); If num 2 mod = 0 even then: = even + num; End; Writelan ('There is even Yoga', even); Readln (); End.   

Any help would be great! When I run it I get the text as "even sum is 0"

The code needs to be corrected, so that it can also be compiled. The reset line calling 0 is closed after ) is invalid syntax.

You first need to initialize your even variable so that it has a valid starting point.

Next, you have to fix the argument in your while loop. It's backwards :-) You num & lt; 50 If you want to stop at last - you have tested num & gt; 50 means that the loop will never be executed, because the first value ( 1 ) while the loop ends.

This is a plain console app in Delphi

  Program 2 project; Uses SysUtils; Var InData: Text; Number, even: integer; Start AssignFile (InData, 'D: \ TempFiles \ numbers.txt'); (Indata) reset; Read (indet, number); Even: = 0; While the number & lt; Start reading 50 (Indet, number); If num 2 mod = 0 even then: = even + num; End; Writelan ('There is even Yoga', even); Readln; End.   

This generates the output (which is correct according to your code, because it reads inside 64 , while num loop and so it should do 1 times more, and even 64 is even added to - I want to remove it for you I will leave for). : -)

  The amount is also 96.    

html5 - Footer separated from other content -


So I have not set the margin on the section before the footer, but somehow it is different and I do not know why Is there any remedy? Thanks!

html:

  & lt; Section & gt; & Lt; Div class = "content" & gt; & Lt; / Div & gt; & Lt; / Section & gt; & Lt; Footer & gt; & Lt; Div id = "footer" & gt; & Lt; / Div & gt; & Lt; / Footer & gt;   

and CSS:

  .content {background-image: linear-gradient (below, RGB (135,127,127) 0%, RGB (37,37, 35) 69%); Background image: -o-linear-shield (below, RGB (135,127,127) 0%, RGB (37,37,35) 69%); Background image: -Mo-linear-shield (below, RGB (135,127,127) 0%, RGB (37,37,35) 69%); Background image: -webkit-linear-shield (below, RGB (135,127,127) 0%, RGB (37,37,35) 69%); Background image: -MMS-linear-gradient (below, RGB (135,127,127) 0%, RGB (37,37,35) 69%); Background image: -Winkit-gradient (linear, left bottom, left top, color-stop (0, RGB (135127127)), color-stop (0.6 9, RGB (37,37,35))  < / Ex> 

);

  #footer {background: url (picture / footer) left top header; Height: 450px; }    

Trying to apply a CSS reset before doing any of your styling Do:

May I use numeric in a javascript object? -


It is my understanding that the keys of objects are always string, however, I believe that the numerical values ​​will be translated into strings if the key , It will not be any kind of prohibited value type. Since we do not use quotation marks around string keys, writing content like this:

  {a: "a_value", b: "b_value", [...]}   

... I thought the stuff could be easy to read:

  {1: "first_name", 4: "whatever" , [...]}   

So my question is: Is it really bad behavior is considered to use numerical values ​​in the form of keys, or am I less Less or less I could Nationality?

Thank you.

You are right that the name of the property should be string, but the conversion is done for you. That is, o = {1: "test" "} is the same as o = {" 1 ":" test "} . Similarly, o [ 45] and o [45] = "Hello" both . , change the property name for you.

This is a Quick display is where I have overridden toString () to make it clear:

  var o = {xyz: 100, toString: function () {console ("Someone stradded me"); Return "Ow";}} var x = {}; x [o] = "test"; // Console says, "Someone was tricked" console.log (x ["Ooo"]); // Console is called "Test"; console.log (x [o]); // console says, "someone stradded me", then "test"   

O is used as a property, it is an indication that it is used in the string using o.toString () , so that the numeric key Using is not a problem. Actually, you can check out ["hi", "ol", "father"] ["1"] and see that it is "[hi", " Ol "," father "] [1]`

Graph all child nodes common lisp -


I need to find all the nodes that are children of the selected node. The graph is designed like this: (Setic Graph 1 '(A (BC)) (B (DE)) (C (FG)) (D), (E (I)) (F), (G) and (H) (J)) (j ()))) So, all children of node b are (at first level), d, e, on second h, i, third j. Here's the code to get children of the first level, but as I am writing, I have been able to work for other people.

  (defun sledG (cvor graf obradjeni) (cond ((null graph) '() () ((equal (Carr graph) Sewer) (Dodj (cadre charts) Obradjeni) (T ( sled Jivr (CDR graph) Obradjeni)) (Dipan Dodj (Potomsi Obradjeni) (code (tap Potomsi) ()) ((member (car Potmsi) Obradjeni) (Dodj (CDR Potomsi) Obradjeni) (t (cons (car Potomsi ) (Dodj (CDR Potomsi) Obradjeni))))) (Setk graph 1 '((A (BC)) (B (D)) (C (FG)) (D (H)) (e (i) () F (J)) (G) ((H)) (I) (J ()))    

using the package:

  ((A B) ((A (BC)) (B) (C) (C) (D), (E (I)) (F (J)) (G) (I (j)) (J. Brown))) (continuous descent (tree label) (LE (t (generation (Nkkashin # 'cadre (delete-if-not (Elekghandria composition (Elekghandria: curry #' ACL label) #) Car) tree)) (Adding Generation (McCann (Alexandria: Curry # 'lineage offspring)) generation)));); (DEHJ)   

I believe Is that you Wanted to. This will work for the escalale graph, but it will do it "forever" if you have a circle in it. If you want to add a depth counter, you can add it as another logic on descendants or enter a counter counter in the last mapcan . >

is included in the depth:

  (root label (tree label) (label ((% descendant (depth label) (give (generation (map # cadre (delete- if- No (Alexandria composition (Alexandria: curry # AGL label) # 'car) tree))) (Aepend (Mapakar (Alexandria: #' Nrhwars (Alexandria: curry # 'of depth) type) (Mapaken (Alexandria: curry # '% Descendant (1 + Depth)) Production))))) (% Scion 0 Label)); (D) (E) (H1) (1 1) (J2))    

javascript - Creating an element that can remove it self? -


I am creating a lightbox as a school project, and I can not use jQuery. I have an image when you click it, creates a transparent div with the javascript id "overlay" I want to remove the div myself, or parents to remove it, but it does not work I think what to do with the fact that you can not link 'onclick' to an element that is not yet present.

You have to remove the element from your parents. Something like this:

  d = document.getElementById ('overlay'); D.parentNode.removeChild (d);   

Or you can hide it:

  d.style.display = 'none';   

And, oh: You can add javascript code to the element (newly created) by specifying a function for the onclick attribute.

  d = document createElement ('div'); D.onclick = function (e) {this.parentNode.removeChild (this)};    

glsl - How to Make Large Matrix Multiply -


I am trying to create a GLSL shader which increases the 90x10 matrix with a 10x1 one. The 90x1 result corresponds to xyz values ​​of 30 seconds. The first big matrix is ​​loaded only at startup. The second matrix, on the other hand, can change in each render.

How can this be done? I am finding that the matrix can be stored in the form of textures, but I do not know what to do with the other.

Pass the second matrix just as a single array of floats.

  Uniform float vec10 [10];   

and display the multiplication element by element.

Note that if this is very slow, then you can try packing your large texture in such a way that you can read 4 elements with the same texflash.

If you want to see the syntax, to force uniform arrays, consult.

Note, it is also completely legal to store these other matrix in the texture; I have the conclusion that it is not certain about the effect of the performance that unlike sending it as a uniform. But first make it work, create profiles and optimize later.

java - Use while loop to add many objects to arraylist -


Take an introduction course in Java using the blues.

Account

Strong> It is easy to add an object to the array list using the loop for a while, although the blues inspires you to choose an account.

I do not know how to automate this process, try something with it:

  Add Public Zero MultiPointPoints () {reader = new InputReader (); System.out.println ("How many accounts do you want to add?"); Int accountsTouad = integer .presscent (reader.jet input); While (accountsToAdd> gt; 0) {System.out.println ("Which account do you want to add?"); String accountToode = ReaderGetInput (); BankAccounts.add (accountToAdd); AccountsToAdd--; }}   

Which clearly does not work InputReader () is a private supply class that uses scanners to collect strings.

I'm sure this is an easy way to do what I'm getting but I can not find it ... I don? T denote the user for input of something, blues has Always do it automatically

  import java.util.ArrayList; Import java.util.Scanner; Public Class Some {/ ** * @ Ultimate Argus * / Public Static Wide Men (string [] Args) {Arrestist & lt; Aclass & gt; List = New Arrestist & lt; Aclass & gt; (); String first, second; Scanner Scanner = New Scanner (System.in); Repeat Int; System.out.println ("How many items do you want to enter?"); Repeat = scanner.xit (); {System.out.println ("Enter your first parameter") for (int i = 0; i & lt; repeat; i ++); First = scanner.xt (); System.out.println ("Enter your second parameter"); Second = scanner.xt (); Aclass temp = new avalose (first, second); // This array will be inserted into list.add (temp); }}} Class ecloss {private string something, apple; Public eccles (string straight 1, string str 2) {anything = str1; Amales = straw 2; }}   

In this case your 'aClass' is your account class and the list is your backends strictly. You obviously need to change the parameters to match your account class, but in this way You will apply it.

powershell - Trying to download a file to a directory on a remote server -


I am getting this error

Call "DownloadFile" with "2" argument Exception to S): "An exception occurred during a web client request."

From this script

  $ username = "administrator" $ password = "password" $ Secstr = New object-type name system. Security. Sequestring $ password Kocharayre () | For the e-object ($ secstr.AppendChar ($ _)} $ cred = new-object -typename system.management.pscdential -streamentlist $ username, $ secstr $ url = "http://www.website.com / File .zip "$ path =" c: \ file.zip "$ client = new-object System.Net.WebClient $ client.DownloadFile ($ url, $ path) Invoke-Command -ComputerName 69.69.69.69 -ScriptBlock {$ Client} is running on Windows Web Server 2008  

The script purpose is to download file.zip to a remote server (there are hundreds of servers so I '

any thoughts?

Try it $ username = "administrator" $ password = "PASSWORD" $ secstr = New object - Type name system. Secstr.AppendChar ($ _)} $ cred = new-object -typename system.management.pscdnsial -remnentList $ username, $ secstr $ command = {$ url = "http://www.website.com / file. Zip "$ path =" c: \ file.zip "$ client = new-object System.Net.WebClient $ client.DownloadFile ($ url, $ path)} Ask-command-computer name 69.69.69.69 - Scriptblocks $ order - Credential $ cred

c# - Using a DatePicker without TextBox (Silverlight Toolkit) WP7 -


I am developing an app for Windows Phone 7.8 (probably WP8 at a later date) whose date the user entered need to. I am currently using DatePicker control from Silverlight Toolkit because I like its visual style

The date picture control, when placed on the page, is shown as a text box, when click The DatePicker opens.

Is there any way the text box is not included in it as I do not need and it is closing my form that there is no way to open DatePicker via code instead of the OnClick event?

Any help is appreciated :)

the way you It looks like you can edit DatePicker's control templates only to replace it.

VS 2012 can do this by default (right click and edit template), otherwise the template needs to be edited using the expression blend.

Specifically, the control template has a button (among other things):

  & lt; Button x: name = "DateTimeButton" Content = "{TemplateBinding ValueString}" ...   

The button content is bound to Value Value if you remove this binding (for example ) Then you will be left with the blank button. You can also add anything to the content of the button ...


These links should help you to use Blend:

< / P>

Guides are also good.

osx - After uninstalling rvm I get the following when opening a new Terminal session -


After uninstalling RVM, I get the following when opening a new terminal session:

 < Code> Last login: tt26000 at 266: 30: 30 -bash: /etc/profile.d/sm.sh: Any such file or directory -bash: /etc/profile.d/rvm.sh: Any such file Or no directory ~ \ $   

How do I determine where it comes from?

  -bash: /etc/profile.d/sm.sh: Such a file or directory -bish: /etc/profile.d/rvm.sh: There is no such file or directory   

By running this installer I have installed the RVM: On the Mac with Mountain Lion. I ran Uninstaller for that package, it was reluctant for RVM, but some traces were omitted, I would not use RVM after some startup, because it was installed with

. For / etc / profile :

  source /etc/profile.d/sm.sh source /etc/profile.d/rvm.sh   

If this is the case, please report a bug for Railsinstaller:

linux - Is ethernet checksum exposed via AF_PACKET? -


As it is contained, it seems that checksum is calculated and verified by Ethernet hardware, so it is highly likely It is not necessary that it is necessary to send frames using the AFPACKET socket when generated by the software, and it seems. Apart from this, I do not think it can be obtained from the socket nor by any simple means, because even Virus Hark does not display it.

So can anyone confirm it? Do I need to send checksum to myself as shown in the last two links? Will checksum be automatically created and tested by the ethernet adapter?

No, you do not need to include it CRC.

When using the packet socket in Linux, while using the socket (AFIFKET, SOCK_RAU, HTTO (atop_AL)) , when you send the layer 2 headers when you send it < Defined in the code> struct ether_header in the netinet / if_ether.h and includes the destination host, source host and type. The frame check sequence is not included, nor is the introduction, frame delimiter or the beginning of the trailer. These are added by hardware.

java - Checking to see if a string is a palindrome or not -


I'm very close to ending one of my practice problems which is related to a palindrome and string parameter and I'm the main method The method to call every time I compile my code, it compiles it, but then when I go to input data it keeps running and does not result in me What to do? The problem just asks to make a method which checks that it is an illusion, my main method is that it is bothering me.

This is my code:

  import java.util. *; Public class TestisPalindrome {public stable boolean isPalindrome (string str) {int left = 0; Int correct = str.length () -1; While (left and lieutenne; right) {if (str.charAt (left)! = Str.charAt (right)) {return false; }} ++ left; right --; Back true; } Public static zero main (string [] args) {scanner scan = new scanner (System.in); System.out.println ("Enter a string to see if this is a palindrome or not:"); String st1 = scan.nextLine (); Println (isPalindrome (st1)); }}    

correct & amp; Left wage increase while loop

  while (left & lt; right) {if (str.charAt (left)! = Str.charAt (right)) {Details are false; } Left ++; right --; }    

unit testing - How to simulate HTML5 Drag and Drop events in javascript? -


As the title, I am trying to simulate an HTML5 drag and drop event in JavaScript.

I 'Jquery.ui.simulate and also seen in simulation function. Simulating both mousedown, MouseMove, by drag and drop simluate, and mouseup which works with jQuery UI objects, seem to be able to be able to.

But the drag / drop events in the pages do not seem to be simulatable using the same method. A mousedown trigger dragstart HTML5 event does not appear to be active.

Is there a way to get either dragent events to execute based on a simulation mousedown / MouseMove / etc, or is there a way to emulate the draggart (and then drop) events directly?

I have tried to modify the HTML 5 Drainet event to add, so I can try something like the following on the demo page

  simulation (document.query) selector (# 'three'), 'Dragrt')   

but I get an error because I did not know how Detatronsfr object simulated Dragrt events correctly.

Actually, I will accept any answer that will pull me three into the 'bin' element or use jquery.ui.simluate (or any other library) or modified version By i found on SO

Your best bet is to rebuild a fake event object.

In my unit test for the drag-and-drop file upload library (, shameless plug), I am doing this with jQuery method. In my source code, I set my drop event listener like element.ondrop () :

  element.ondrop = function (e) {e.preventDefault (); ReadFiles (e.dataTransfer.files); };   

And then I can test by making a fake event object and passing it in the ondrop method.

  element .Ondrop ($. Event ('drop', {data transfer: {files: []}}));    

jquery - Automatically set a checkbox replacing div to "checked" -


I have a function that creates internal devices for parent devices, it receives 2 parameters: "div_id" and The "visitor_entered" function also puts a checkbox in one of these designs and replaces it with a div with a background image. When I click on div - it changes the background image, then I do this:

  $ ("# checkbox_" + div_id) .each (function () {$ (this ) .hide (). Later ("& lt; div class = 'Class_checkbox' id = 'visitor_entered _" + div_id + "' /" gt; ");}); $ ("# Visitor_entered _" + div_id) .on (. $ (This 'click', function () {$ (this) .toggleClass ('check') Previous (). Sahara ('check',) .is ( 'Checked'));});   

Now what I want, when this function runs, to see that "visitor_entered" is equal to 1, and if so-- "# checkbox _" + div_id div To "check" I tried to do this:

  if (visitor_entered == 1) {warning ("1, true!"); $ ("# Visitor_entered _" + div_id) .prop ('checked', $ (this) .is () 'checked'.); }   

It was alert when needed, but div to check is not set, how can I do this?

** edit **

whole function:

  function create_inner_divs (div_id , Visitor_entered) {for (var i = 0; i & lt; 6; i ++) {divs_array [i] = div_id * 10 + i; Var div_width = 704/6; $ ("& Lt; div id = '' + divs_array [i] +" 'style =' width: "+ div_width +" pixel; float: ok, word-wrap: normal; word-break: break-all; Padding: 0 2px 0 2px; 'gt; & amp; nbsp; & lt; / div & gt; "). Attachments (" # div_visitor _ "+ div_id);} $ (" & lt; div id =' div_visitor_entered _ "+ Div_id + 'class =' ​​div_visitor_entered '& gt; & lt; input name =' checkbox_visitor_entered 'type =' checkbox 'id =' checkbox_" + div_id + '' class = 'input_class_checkbox' & gt; & Lt; / div & gt; "). AppendTo (" # div_visitor _ "+ div_id); $ (" & lt; div id = 'div_print_voucher_icon' class = 'div_print_voucher_icon' 'gt; & lt; / div & gt; "AppendTo" ("# div_visitor _" + div_id); $ ("div id = 'delete_visitor' class = 'delete_visitor'"> 
) "appendTo (" # div_visitor _ "+ Div_id); $ (" # Checkbox_ "+ div_id) .Each (function () followed by {$ (this) .hide () (" Lt; div class = 'class_checkbox' id = 'visitor_entered _ "+ div_id +' '/ & gt; ");}); $ ("# Visitor_entered _" + div_id) .on (. $ (This 'click', function () {$ (this) .toggleClass ('check') Previous (). Sahara ('check',) .is ( 'Checked'));}); If (visitor_entered == 1) {Warning ("1, true!"); $ ("# Visitor_entered _" + div_id) .prop ('checked', $ (this) .is () 'checked'.); }}

Ah yes! I think I have it!

  if (visitor_entered == 1) {warning ("1, true!"); // Here, you are trying to set a "check" property ... on a DIV // Because of that, you are unable to find anything, because there is no such property which is a div unit / / The only reason that your click event handler seems to work in the code is that you are toggling the class on the div at the same time / at the same time you have property $ ("# visitor_entered_" + div_id) Trying to change) .prop ('check', $ (this) .is ('checked')); }   

You need to manage the states of both elements ... do something like, instead:

  if (visitor_entered == 1) {Alert ("1, true!"); Var veDiv = $ ("# visitor_entered_" + div_id); // First, toggle the square on the related checkbox: veDiv.toggleClass ('check'); // Second, find the Brother checkbox var vechk = veDiv.prev ('[type = checkbox]'); // Now set that checkbox checked property ... which does not accept // boolean value ... this is either empty // (unchecked) or 'check' veChk.prop (' Check ', (veChk. (': Check '))' ':' check '); }   

(sorry ... copy and paste from your code will not fix this problem)

One of the downsides to make this much more channing It is easy to believe that you are killing the right things on every part of the series. When you start the problems, break it so that you can test each perception separately. I probably used to manage your on-click in such a way:

  $ ("# visitor_entered_" + div_id) .on ('click', function () {// you already have One reference is the clicked div, so get my // instantly checkbox @ myChk = $ (this) .prev ('[type = checkbox]'); // toggle div's square $ (this) .toggleClass ('check '); / / And then toggle the checked property myChk.prop (' check ', (veChk.is (': checked '))' ':' check ');});   

(Your onclic code had to be applied to the same fix as the code above ...)

Good luck!

matplotlib - Extracting and plotting tabulated plaintext data using Python 3 -


The context in which I am referring to the purposes of clarity is an abstract of the example of that format:

After some other irrelevant data, many of these are tabulated blocks in the output file, one directly after the other, the header section is repeated every time. Up to eight sets of headings are readings, including a block. In the header, the organization of values ​​for the readings of the organization of quantities shows the value.

Given this, I need to remove the values ​​of some quantities given in the header, put them in a file with them, and the matplotlib plot volume vs. one set versus the other. For example, Eg_Tot vs. Time (PS).

I'm completely lost because it is okay to use Python or Maplibtb out of my experience, so any help is welcome.

This is not a complete answer, but you should start it.

  #! / Bin / env # Some functions that determine whether a line is a separator def / CSP (line): return (line CO ('-')> 80) # Some functions that parse "block" DRR parse_block (Lines for lines in: parsed_lines = [] in lines: matches = re.findall ('(\ S +)', line) parsed_lines.append (mail) return parsed_lines if __name__ == "__main__": # data Open with 'Data.txt', 'r') as FH: data = fh.read () # divide the data into the rows, then the rows in the "block" block and Split [=] block_lines = [] to line in data.splitlines (): if (is_sep (line)): block.append (block_lines) block_lines = [] other: block_lines.append (line) # This partition method is a Empt will form the first element of the "block" list, block it to block = block [1:] # block for block, but header block, block it in "parse_block" parsed_blocks = [] block [1: ]: Parsed_blocks For example, the last block of your data will be parsed:  
  

Code> [['1', '2.6814 E + 03', '3.3117E +02', '1.6616E +03', '-1.1814 A +02 ',' 1.8312E +03 ',' 3.5247E +03 ',' 2.5879E + 02 ',' -3.8350E +03 ',' 0.0000E + 00 '], [' 0.0 ',' 2.5785E + 04 ',' 6.8687 E +01 ',' -6.7273 E +04 ',' -7.6310E +3 ',' -1.8316E +03 ',' -5.7811E +04 ',' 0.0000E +00 ',' 0.0000 E + 00 ',' 0.0000E + 00 '], [4.9]', '1.3300E +04', '0.0000E + 00', '0.0000E + 00', '0.0000E + 00', '9.0000E + '01', '9.0000 E + 01', '9.0000E + 01', '0.0000E + 00', '1.1 911E + 02'], [], ['Rolling', '2.6814 A + 03' '3.3117 E +2', '1.6616E +03', '-1.1814E + 02', '1.8312E +03', '3.5247E +03', '2.5879E02', '-3.8350E +03' , '0.0000 E + 00'], ['Avg', '2.5785 E + 04', '6.8687E + 01', '-6.77273E +04', '-7.6310E +3', '-1.8316E +03 ',' -5.7811 E +04 ',' 0.0000 E + 00 ',' 0.0000E + 00 ',' 0.0000E + 00 '], [' 1.3300E + 04 ',' 0.0000E + 00 ',' 0.0000 E + 00 ',' 0.0000 E + 00 ',' 9.0000E + 01 ',' 9.0000E + 01 ',' 9.0000 E + 01 ',' 0.0000 E + 00 ',' 1.1 9 11E + 02 ']]

ios - UIView suddenly disappears -


I have a basic iOS app, which creates a visual hierarchy by pushing viewcontrollers on the root navigation controller.

Occasionally I think the app suddenly disappears. It is unlikely to crash, because the app is still present within the iPad work bar, but it seems that unloads one or more ideas, leaves the user back on the homepage. The app still appears in the iPad taskbar, and it can be opened again by tapping the icon in the taskbar.

Can UVOs disappear in this way? How can I go about debugging it?

Many thanks

iOS apps can not be hidden or at least If you are using your app and suddenly you are in the Home screen where all apps are listed then your app crashes.

If you are using Exode to install and test your application, you can go to Organizer-> Device and select your device and check the device. Login to see what happened when your app crashes.

It is certain, if the app crashes, nothing is displayed on the console / debug area.

If you have ARC in your app and if the app crashes, nothing is displayed on the debug area, then I can bet that there is a low memory accident, the type of crash is usually the error Do not give Xcode time to log, but you can validate it on device logs if so, then I recommend switching the ARC in your app and using it.

java - Unable to send the data to Openbravo ERP through HTTP POST -


एचटीटीपी पोस्ट में httppost = new HttpPost (url); अगर मैं ओपनब्रावो-एआरपी में एक मॉड्यूल का उपयोग करने की कोशिश कर रहा हूं तो यूआरएल क्या हो सकता है: 8080।

आशा है कि यह मदद करता है!।

bundler - Deploying a Ruby Command Line Application that Depends on Non-Rubygems-Hosted Gems -


I'm trying to deploy a small command-line app written in Ruby. I have several gems in the Jethab account which are dependent on the application. I have properly specified my location in Gemfile when I clone the repo on the deployment machine and from the root Bundle install , all are easily done. Then I can run the command line app (name "hippo") with bin / hippo I would like to install the app on the system so that I do not need to patch $ PATH Be specific, or specify the path of executable to use it.

When I run Mani install / path / to / my / gm / file , the installation fails and says that it is on my personal gems hosted on my Jethab account Dependency can not be solved. I collect it because install gem command jamfile , not just read gemspec (Earth gave the name of its file to the bundler. Instead of Gemfile BundleFile or something else?), And the location of gems are specified in Gemfile (no matter github gem in a gemspc, right?). I have the same problem when I use the rake install function that comes with a bundle-staging gem. However, when I run the bundle exec gem install / path / to / my / gemfile , it installs OK, I think because it sees my gems on the bundler-changing load path and decides Does that they are already established. But again, when I try to run executable, it fails because it can not depend on the necessary requirements. (Note that requires bundler / setup in executable as its first line after Shebang).

So I ask: What is a good way to deploy with Bundler, a line app that relies on non-RubyGames-hosted gems?

Bundle enabling set up your load path correctly When you need to bundler / setup , the gems appear to be always binary running with bundle adi bin / hippo .

For some of your purposes, something may be more suitable for bundle install --standalone , which will have a bundle / bundler / setup .bb The file creates this file correctly for you to set the load path, so you just need , such that instead of need_relative '../bundle / bundler / setup' 'Bundler / setup' for your code.

ios - iPhone 5 front camera - tap to focus? -


Using the AVFoundation framework, I've been focused to use this code:

  - (zero) AutofocusPoint: (CG point) point {NSArray * devices = [AVCaptureDevice devices]; (For devices in AVCaptureDevice * device) {[unlockForConfiguration device]; (If [device is lockedForCorrectation: zero]) {If ([device lockforge structure: zero]) (if [[Device is FocuspointErrorIreate supported] & amp; amp; amp; device [FocusMode is supported: AVCaptureFocusModeAutoFocus] Device Set FocusPointOf Interest: Point]; [Device Set Focus: AvcapturefoxSamadAtofocus]; [Device Set ExposurePointOf the Interest: point]; [Tool set Exposure mode: AVCepture exposure modeContinuousAuttextaxer]; [Device Lockforcing: Zero]; }}}}   

}

It should go through both front and rear cameras and focus them. It is known through every device, but for the front camera it does not get before the isFocusPointOfInterestSupported line. But you can tap to focus on the front camera using the iPhone 5. At least you are enabled on the Camera app. So what's the problem ???

Thanks for the help

I do not know whether the iPhone 5 support front Camera is Focus, but according to the official doctor,

The iPhone 4's front camera does not have the focus mode, probably the iPhone 4S either

python - UnicodeDecodeError: 'ascii' codec can't decode byte 0xa3 -


मुझे यह स्ट्रिंग 'Velcro Back Rest \ xa36.99' मिला है। ध्यान दें कि इसके पास u सामने नहीं है इसकी सिर्फ सादे आस्की

मैं इसे यूनिकोड में कैसे बदलूं?

मैंने इसे करने की कोशिश की,

  & gt; & gt; & gt; यूनिकोड ( 'वेल्क्रो वापस बाकी \ xa36.99') Traceback (सबसे हाल कॉल पिछले): फ़ाइल "& LT; stdin & gt;", लाइन 1, & lt; मॉड्यूल & gt; UnicodeDecodeError: 'ascii' कोडेक स्थिति 17 में बाइट 0xa3 डिकोड नहीं कर सकते: सीमा (128) में नहीं क्रमसूचक   

यह अच्छी तरह समझाने। लेकिन मेरे पास उस प्रश्न के ओपी के रूप में है। उस टिप्पणी के जवाब में विंस्टन

लेकिन मैं काम कर रहा हूँ ढांचे के लिए यह यूनिकोड स्ट्रिंग परिवर्तित किया जाना चाहिए। मैं scrapy का उपयोग करें और मैं इस लाइन।

  loader.add_value ( 'नाम', PRODUCT_NAME) है   

यहां product_name शामिल कि समस्याग्रस्त स्ट्रिंग और यह त्रुटि फेंकता है

आप के साथ यूनिकोड बाइट्स डिकोड करने के लिए एनकोडिंग निर्दिष्ट करने की जरूरत है:

  & gt; & gt; & gt; 'वेल्क्रो वापस रेस्ट \ xa36.99..decode (' latin1 ') u'Velcro वापस विश्राम \ xa36.99' & gt; & gt; & gt; प्रिंट 'वेल्क्रो वापस रेस्ट \ xa36.99..decode (' latin1 ') Velcro वापस आराम 6.99 £   

इस मामले में, मैं अनुभव से एन्कोडिंग अनुमान करने में सक्षम था, आपको आवश्यकता है प्रत्येक एन्कोडिंग के लिए उपयोग किए जाने वाले सही कोडेक प्रदान करने के लिए वेब डेटा के लिए, जो आम तौर पर सामग्री-प्रकार हैडर में से होता है:

  सामग्री-प्रकार: टेक्स्ट / html; Charset = iso-8859-1   

जहां iso-8859-1 लैटिन 1 एन्कोडिंग के लिए आधिकारिक मानक नाम है, उदाहरण के लिए। iso-8859-1 के लिए एक उपनाम के रूप में latin1 पहचानता है।

ध्यान दें कि आपका इनपुट डेटा नहीं सादे ASCII । अगर ऐसा होता है, तो यह केवल 0 से लेकर 127 तक की सीमा में बाइट का उपयोग करता है; \ xa3 163 दशमलव है, इसलिए एएससीआईआई श्रेणी के बाहर।

javascript - Call parent function from iframe with firefox -


मेरे पास एक iframe है जिसमें मेरे पास निम्न कोड है:

  $ (document) ($ ('। चेकसम') क्लिक करें (फ़ंक्शन () {window.parent.Clickarunsuministro ($ (this) .val ());})}})   < P> जब आप  .checksum  पर क्लिक करते हैं, तो मैं फ़ंक्शन को पैरेंट में कॉल करना चाहता हूं। यह क्रोम और आईई में पूरी तरह से काम करता है, लेकिन फ़ायरफ़ॉक्स में नहीं।  

जो त्रुटि दिखाई देती है वह है:

  संपत्ति को 'प्रवेश के लिए अनुमति से वंचित' clickarunsuministro '  

कोई भी विचार क्या समस्या हो सकती है?

अगर आइएरेम और वे जो पन्ने चलते हैं , सामान्यतः, सुरक्षा कारणों से प्रत्यक्ष रूप से बातचीत करने की अनुमति नहीं है इसके बजाय, आप संदेश इवेंट्स का इस्तेमाल कर सकते हैं, स्ट्रिंग्स और जेएसन ऑब्जेक्ट्स को खुदरा दस्तावेज़ और आइफ्रेम के बीच भेजने के लिए। कैसे और क्यों पर कुछ विवरण देखें।

आपका कोड अभी और क्रोम और आईई में काम कर सकता है, लेकिन यह एक सुरक्षित शर्त है कि यह जल्द ही भविष्य में आपके कोड में बेहतर होगा मामले।

regex - RegExp for dates Extjs 3.4 -


I have trouble creating regExp for search panel

  & amp; Amp; (Item.Get ('prompt')> date = dateStartValue.format ("Y-M-D") & amp; Amp; (Item.get ('prodAddDate') & lt; = dateEndValue.format ("Y-M-D"));   

I'm not sure that this is work for refExp, but I do not have any other ideas

The problem is that when I can not fill the field with the date I can not filter data with other conditions

I was trying something like this but not working

  & amp; ((Item.get ('prodAddDate') & gt; dateStartValue.format ("Y-M-D")) (New RegExp (dateStartValue). Exam (item.get ('prodAddDate')) & Amp; Amp; ((Item.get ('prodAddDate') & lt; = dateEndValue.format ("Y-M-D")) || (New RegExp). Test (item.get ('prodAddDate'));    

Not entirely sure what you are trying to do, but Here are some pieces of information that I hope can help you solve your problem.

Priority of comparison operators

and operator priority || , which means that:

  A || B & amp; C || D is equivalent to   

:

  A || (B & amp; c) || D   

No:

  (A || B) & amp; Amp; (C) || Date comparison  

You can compare objects directly to date : Code> // example data var d1 = new date ('2012-12-12'), D2 = new date ('2012-12-12'), d3 = new date ('2013-01-01') ;

and you & lt; , & gt; , & lt; = , and & gt; = :

  // logical results D1 & lt; D3 / True D1 & Lt; D2 / False D2 & gt; D3 / false D1 and LT; = D2 / true D1 = & gt; D2 // true   

but not comparing equality with == :

  d1 == d2 // still Wrong // ... D1 and LT; = D2 & amp; D1 = & gt; D2 // True   

Conclusion: To test that a date before or after a date, direct comparison is OK. But, if the two dates are the same, then compare the string to test it:

  // Is that the same day? D1.format ('y-m-d') === d2.format ('y-m-d') // True // Is this the same day and hour? D1.format ('Ymd H: i: s') === d2.format ('Ymd H: i: s') // true   

Ext.isEmpty () null , undefined and empty string '' only
  Ext.isEmpty (Empty) // True Ext.isEmpty (Undefined) // True Ext.isEmpty ('') // True Ext.isEmpty ('') / / False Ext.isEmpty (false) // false // etc.   

This can be useful for addressing your blank field case:

  ... & amp; & Amp; (Ext. Istity (Ietate.Gate ('ProdaidDate'). Item () ('Promoded') & gt; = DataStart Value) & amp; Ent.ISTT (iTet.Jet (ProdaidDate) || 'ProdAddDate') & lt; = dateEndValue)   

Finally

about regex What is this obsession? They are useful for testing / removing complex strings, but this is all you should forget about them for a little while, dude, p

eclipse - adding annotations to file outside workspace -


I need to show comments on files outside the workspace.

I am able to show annotations on files in presentspace when I try to do this for files outside the workspace, then I need to create resources and the Eiffel object. How do I get it? I am unable to create an eighth object, so I can read the contents of the file outside the workspace.

Here I am doing that now:

  wins IEditorPart editor = (IEditorpart) [ii] .getPartService (). GetActivePart () IEditorInput = Editor .getEditorInput (); Ipath path = ((FileEditorInput) input) .getPath (); IFile File = Vertical .getRoot (). GetFileForLocation (path);    

In case of bus you do not know, is not for files and projects < / Em> on the workspace on the file system under the workspace folder.


Maybe you can add it as a file in a workspace and as a resource. I do not think an external file that is converted into an internal file loses any behavior, It can be as much as you want, one that I can think of, that source control plug-ins can then detect it

Or, you can tell the user to add the file to the workspace. The benefits And make them choices. You may be able to show a dialog so that it can be asked whether the new or existing project / folder is where to add it. Of course, if they reject, then you should remember and not again about that external file Should ask.

Update:

FileStoreEditorInput represents a file that is not part of the current workspace. To listen to external files, subscribe to each window with an IPartListener2.

  Public Sky Actuator applies to Astrot UIU Lugin iTartup {@ Override Public Wide Start Startup} {Final Part Listener Part Listener} New Part Listener (); (Last IWorkbenchWindow Window: getWorkbench (). GetWorkbenchWindows ()) {window.getPartService (). AddPartListener (partListener); } GetWorkbench (). AddWindowListener (new IWindowListener () {@Override Public Zero Window Opened (IWorkbenchWindow Window) {window.getPartService (). AddPartListener (partListener);}}); } Private class part listener applies IPartListener2 {@Override Public Zero partOpened (last IWorkbenchPartReference partRef) {if (partRef.getPart (example) editor of the example) {Final editor page editor = (EditorPart) partRef.getPart (wrong); If (editor.getEditorInput () instanceof FileStoreEditorInput) {Final FileStoreEditorInput Input = (FileStoreEditorInput) editor.getEditorInput (); Println (input.getURI ()); }}}}    

oop - PHP using objects instead of arrays -


When I started learning OOP programming, I read that everything is an object, the most time to develop in PHP Here is an important role of arrays for example:

  class product {private $ data = array}; For example:  

For example:

public function __ composition () {$ this- & gt; Data ['settings_1'] = 'a'; $ This- & gt; Data ['setting_2'] = 'b'; $ This- & gt; Data ['setting_3'] = 'c'; $ This- & gt; Data ['setting_4'] = 'D'; $ This- & gt; Data ['setting_5'] = 'E'; }}

Do you mean making the classes for everything while using PHP? For example:

  Classroom Product {Private $ settingEND_A_1, $ setting_2, $ settings_3, $ settings_4, $ setting; }   

And then in another category (example model), return the item to the class product immediately and instead of the array (such as for controller)?

"Everything is an object" in mindset, keep in mind that it applies to languages ​​that OO was based from 1 day PHP is not one of those languages, things were added after the fact, your simple variable type objects in PHP are small, they are & amp; Simple pieces of memory.

This division is hair, but if you do not need to use any object in PHP, then not simple arrays are lighter than the array. By lightening I mean that they use less rams, and in turn, move a bit faster.

The best advice you have about writing PHP is KISS (keep this simple stupid).

c++ - Why do we need to use virtual ~A() = default; instead of virtual ~A() {} in C++11? -


In the stack overflow post , I have the comment:

In C +11 you really want to do virtual ~ A () = default; Otherwise, you will lose the alleged driver.

virtual ~ A () = what is default; For ? Virtual ~ A () {} ?

The comment is not correct.

both:

  virtual ~ a () = default;   

and

  virtual_a () {}   

user declared . And inhibit members of the inactive conduction if the destroyer user is declared.

[dcl.fct.def.default] / p4 User declared and User provided Special member:

A special member function is provided by the user if it has been declared by the user and clearly not declared in the previous announcement or has been removed. / P>

php - AJAX chat commands - if command doesn't exist, echo error -


I have these command handling:

$ message = entered message

  Public function handle comand ($ message, $ user name) {// variable which we are going to use $ space = strpos ($ message, ''); # First place $ command = trim (substr ($ message, 1, $ location)); # Slash $ name = substr ($ message, $ space + 1) command; # Name after the order Switch ($ command) {case 'ban': $ this- & gt; Restriction ($ name, $ user name); break; Case 'prune': $ this- & gt; Redemption ($ username); break; Case '': echo 'please use an order!'; break; Case 'test': {$ this-> Try the exam ($ name); } Hold (exception $ r) {echo $ r- & gt; GetMessage (); } break; }}   

This will basically check the command.

The words given after $ command = slash ("/").

You can see that

  case:   

It basically checks that there is no order after the slash.

Question: I want the system to be checked, if the command exists in the case. For example:

User wrote:

/ Hello

But this command is not present, consider that We have only 'ban', case 'prune', 'trial' and 'case'.

There is no case 'hello', so it will throw an error. Is there any such thing which does this kind of thing? How can I do this?

I believe what you want is a default: case .

Example:

  & lt ;? Php switch ($ i) {case 0: echo "i is equal 0"; break; Case 1: The echo "I am equal to 1"; break; Case 2: Echo "I equal 2"; break; Default: Echo "is not equal to ii, 1 or 2"; }? & Gt;   

Edit : Fixed version of the problem about which was spoken:

java - How to ignore prefix in spring view resolver -


इस तरह से मैं अपने जेएसपीएस का स्थान प्रीफ़िक्स करता हूं

  & lt; bean id = " viewResolver "class =" org.springframework.web.servlet.view.InternalResourceViewResolver "पी: viewClass =" org.springframework.web.servlet.view.JstlView "पी: उपसर्ग =" / WEBINF / अन्य / विचारों / "पी: प्रत्यय = "। Jsp" / & gt;   

मेरे नियंत्रक में मैं

  संरक्षित स्ट्रिंग रेंडर डीफॉल्ट (RenderRequest अनुरोध, मॉडल मॉडल) का उपयोग करता हूं {वापसी "दृश्य"; }   

क्या कोई वैसे भी मैं एक पूर्ण पथ वापस कर सकता हूं जैसे कि

  return "/ WEBINF / common / thisView"   

मुझे पता है कि मैं सही jsp पर पहुंचने के लिए ../common/thisView का उपयोग कर सकता हूं लेकिन यह समस्या पैदा कर सकता है यदि क्लासपाथ को बदलना है।

के प्रलेखन के अनुसार:।

देखें नाम या तो स्वयं हो सकता है संसाधन URL या एक निर्दिष्ट प्रारंभिक और / या प्रत्यय द्वारा संवर्धित हो

आप वापस निरपेक्ष पथ दे सकता है।

निरपेक्ष पथ हर जगह लौटने से बचने के लिए, आप कई <कोड निर्धारित कर सकते हैं> ViewResolver (अपने मामले एकाधिक में < कोड> इंटरनल रिसोर्सव्वेजरसॉल्वर ) का उपयोग करके रिज़ॉल्यूशन ऑर्डर को परिभाषित करने के लिए order विशेषता का उपयोग कर रहा है। ।

Saving to 3 decimal places using QueryNew and QuerySetCell in ColdFusion -


कोल्डफ्यूज़न 9

मेरे पास यह क्वेरी है:

  & lt; cfset final_standings_table = QueryNew ( "p_final_standing_id, f_group_id, जीत, हानि, टाई, अंक, win_loss_per, games_played, f_division_id, str_division, str_group_name, str_group_url, स्कोर", "CF_SQL_INTEGER, CF_SQL_INTEGER, CF_SQL_INTEGER, CF_SQL_INTEGER, CF_SQL_INTEGER, CF_SQL_DECIMAL, CF_SQL_DECIMAL, CF_SQL_INTEGER, CF_SQL_INTEGER, CF_SQL_VARCHAR, CF_SQL_VARCHAR, CF_SQL_VARCHAR, CF_SQL_INTEGER ") & gt;   

7 वें स्थान (win_loss_per) में (CF_SQL_DECIMAL) देखें

मेरा ग्राहक तीन दशमलव स्थान चाहता है, लेकिन जब मैं गणना रिकॉर्ड करने का प्रयास करता हूं

  & lt; cfset temp = QuerySetCell (अंतिम_स्टैंडिंग_टेबल, "win_loss_per", "#evaluate ((total_wins + total_ties / games_played) #", fml_row_count) & gt;   

मैं इसे केवल दो दशमलव स्थानों पर प्राप्त कर सकता हूं।

मुझे पता नहीं है कि आपके कोड / मूल्यों के साथ क्या हो रहा है, लेकिन आपके मूल्यों के दशमलव स्थानों की संख्या querySetCell () से कोई लेना देना नहीं है या यह कि आप डेटा को किसी भी क्वेरी में डाल रहे हैं।

यह कोड दिखाता है कि दो दशमलव से अधिक स्थानों:

  q = queryNew ("डेटा", "दशमलव"); queryAddRow (क्यू); क्वेरीसेटेल (q, "डेटा", पीआई ()); writeDump (क्यू);   

यह क्वेरी में 3.141592653589793 का परिणाम है। यदि आप इसे 3DP को छोटा करना चाहते हैं, तो ऐसा करने के लिए numberFormat () का उपयोग करें।

तो आपको हमें यह जानकारी देने की आवश्यकता है कि क्या चल रहा है अगर यह काम नहीं कर रहा है आप।

क्या आप कुछ स्वयं-युक्त, पूरी तरह से अकेले कोड प्रदान कर सकते हैं जो समस्या को दर्शाता है? IE: एक repro केस।

javascript - Reverting Form Data with Cancel button -


Is there a great way to include the cancellation (or again) button next to a form that is essentially

For example,

  1. is a user's account and wants to change its username.
  2. In the form they come, see that the input field has the username population: joeuser
  3. they start editing the area and change their mind
  4. possible with the support of too much hacking ? I thought HTML5 History API can be used in some way for this.

    You can use jQuery: $ ("#FormId") [0]. Reset ();

php - Unknown error when matching passwords -


The following code is for a sign up form and comes auto generated from the WYSIWYG Web Builder. It keeps saying password and confirmpassword is not the same. I do not know anything about PHP, so I can not find the error.

I need help with this:

  & lt; Php $ mysql_server = 'db4free pure'; $ Mysql_username = '----'; $ Mysql_password = '----'; $ Mysql_database = '----'; $ Mysql_table = 'userdb'; $ Success_page = './userpage.php'; $ Error_message = ""; If ($ _SERVER [ 'REQUEST_METHOD'] == 'POST' and amp; $ amp; $ amp; $ amp; $ [_POST [ 'form_name'] == 'Sainapform') {$ newusername = $ _POST [ 'username1' ]; $ Newemail = $ _POST ['email']; $ Newpassword = $ _POST ['password1']; $ Confirmpassword = $ _POST ['Confirm Password']; $ Newfullname = $ _POST ['Full name']; $ Code = 'NA'; If ($ newpassword! = $ Confirmpassword) {$ error_message = 'Confirm password and password are not the same!'; } And if (Preg_match ("/ ^ [A-Za-z0- 9 _! $ $ {{1,50} $ /", $ newusername)) {$ error_message = 'Username is not valid, please check And try again! '; } Else if (! Preg_match ( "/ ^ [A-Za-z0- 9 _! $ $ {$ 1,50} $ /", $ newpassword)) {$ error_message = 'password is not valid, please Czech and Try again! '; } Else if (! Preg_match ( "/ ^ [A-Za-z0- 9 _! $ $. '& Amp;] {1,50} $ /", $ newfullname)) {$ error_message =' Puarnnam is not valid , Please check and try again! '; } And if (Preg_match ("/^.+@ ++++++", $ newemail)) {$ error_message = 'Email is not a valid email address, please check and try again.'; } If (empty ($ error_message)) {$ db = mysql_connect ($ mysql_server, $ mysql_username, $ mysql_password); If (! $ Db) {die ('Failed to connect to database server! & Lt; br & gt;' Mysql_error ()); } Failed to select mysql_select_db ($ mysql_database, $ db) or die ('databases & lt; br & gt;' mysql_error ()); $ Sql ​​= "Select by username". $ Mysql_table "WHERE user name = '". $ Newusername "; $ Result = mysql_query ($ sql, $ db); if ($ data = mysql_fetch_array ($ result)) {$ error_message = 'username already used Please choose another username.';}} If ( empty ($ Error_ message)) {$ crypt_pass = md5 ($ newpassword); $ Newusername = mysql_real_escape_string ($ newusername); $ Newemail = mysql_real_escape_string ($ newemail); $ Newfullname = mysql_real_escape_string ($ newfullname); $ Sql ​​= " INSERT "" $ mysql_table "" ( `username ',` Pasward`, `Puarnnam`,` Imel`, `Skriy`,` Kod`) values ​​(' $ newusername ',' $ crypt_pass '' $ Newfullname ',' $ Newemail ', 1,' $ code ') "; $ result = mysql_query ($ sql, $ db); mysql_close ($ database); $ theme = 'Your new account'; $ Message = 'A new account has been created.'; $ Message. = "\ R \ nUsername:" $ message = $ Newusername; $ message. = "\ R \ n Password: "$ message. = $ Newpassword; $ message. =" \ R \ n "; $ Header =" From: webmaster@yourwebsite.com "." \ R \ n "; $ header. =" Reply-To : Webmaster @ your website. " \ R \ n "; $ header. =" MIME-Version: 1.0 "." \ R \ n "; $ header. =" Content-type: text / plain; Charset = UTF-8 "." \ R \ n "; $ header. =" Content-Transfer-Encoding: 8 bit "." \ R \ n "; $ header. =" X-Mailer: PHP V ".phpversion Header ('location:'. $ Success_page); go outside;}}? & Gt; Field 'password1' is actually the name of 'password' ('$', '$', '$'    

Only id 'password1', but it is not used in post data

html - FontAwesome icons inside anchors not animating on chrome -


I am trying to animate a fontawesome icon, within a period it works fine, but when I Putting an icon inside an anchor stops working on Chrome, it works on IE.

I am using FontAwesome 3.2.1 and this is my code

HTML:

  & lt; One & gt; & Lt; I class = "icon-wrench rotator" & gt; & Lt; / I & gt; & Lt; / A & gt;   

CSS:

  .rotator {display: inline-block; Webkit-Animation: Rotate 2.5 S4 Ease; -webkit-change-origins: 90% 35%; } @ -webkit-keyframes {{-webkit-transform: rotate (-12deg) to rotate; } To {-webkit-transform: rotate (112deg); }}   

I tried it with FontAwesome 3.0.2 and it works, when I upgraded to 3.2.1, then stopped working on Chrome at least .

Edit I have more HTML inside the anchor and I do not want to rotate it so that the anchor is connected to the 'rotator' class,

Edit This is the actual HTML (the above example has been simplified):

  & lt; A href = "#" class = "dropdown-toggle" data-toggle = "dropdown" & gt; & Lt; I class = "icon-bell-alt icon-animated-bell icon-only" & gt; & Lt; / I & gt; & Lt; Span class = "badge badge-success" & gt; 5 & ​​lt; / Span & gt; & Lt; / A & gt;    

Add rotator class instead of anchor This page will start rotating on load, this value What do you want to do?

  & lt; One square = "rotator" & gt; & Lt; I class = "icon-wrench" & gt; & Lt; / I & gt; & Lt; / A & gt;   

Edit: Can not you wrap the icon in a divan and specify a free square as a workaround?