Wednesday, 15 June 2011

JavaScript: How to retrieve document object of HTML object tag? -


मैं ऑब्जेक्ट तत्व (टाइप = "टेक्स्ट / html") के अंदर दस्तावेज़। Open / write / close अनुक्रम को कॉल करने का प्रयास करता हूं। सफारी / क्रोम में मैं सामग्री दस्तावेज़ विशेषता द्वारा आंतरिक दस्तावेज़ ऑब्जेक्ट को पकड़ने में सक्षम हूं। नमूना कोड (jquery का उपयोग करके):

  $ (दस्तावेज़) .ready (फ़ंक्शन () {var कंटेनर = $ ('& lt; ऑब्जेक्ट / & gt;')। Css ({'width': '700px', 'height': '100px', 'border': '0px none'}) .attr ({'type': 'text / html'}) appendTo ('body'); var doc = container (0) .contentDocument; doc.open (); doc.write ('& lt; h1 & gt; हैलो वर्ल्ड! & Lt; / h1 & gt;'); doc.close ();}) प्राप्त करें;   

क्या अन्य ब्राउज़रों में ऐसा करने का कोई तरीका है?

मैं ऐसी अजीब बात करना चाहता हूँ क्योंकि मुझे दस्तावेज वाले बाहरी लिपियों को कॉल करने की आवश्यकता है। DOM बंद होने के बाद। मैंने पहले से ही iframes से निपटने की कोशिश की है, लेकिन इंटरनेट एक्सप्लोरर और ओपेरा की वजह से मैं विफल रहा। इस लक्ष्य को प्राप्त करने का कोई अन्य तरीका सराहा जाएगा।

यह आपके लिए काम करना चाहिए। मुझे पता नहीं क्यों (मुझे केवल संदेह है)।

  $ (दस्तावेज़) .ready (फ़ंक्शन () {var कंटेनर = $ ('& lt; ऑब्जेक्ट & gt;')। Css ( {'चौड़ाई': '700px', 'height': '100px', 'border': '0 none'}) .attr ({'type': 'text / html', 'data': 'about: blank' }) .appendTo ('body'); function writeToDoc () {var obj, doc; obj = container.get (0); अगर (obj.document) {doc = obj.document;} और यदि (obj.contentWindow) {Doc = obj.contentWindow.document;} और यदि (obj.contentDocument) {doc = obj.contentDocument;} अगर (डॉक्टर) {doc.open (); doc.write ('& lt; h1 & gt; वर्क्स! & Lt; / H1 & gt; '); doc.close ();} और {$ (' शरीर ')। अनुलग्नक (' & lt; h1 & gt; कोई भाग्य नहीं ... & lt; / h1 & gt; ');}}; // हाँ, ये है अजीब सेट टाइमआउट (लिखोडॉका, 0);});    

visual studio 2012 - How to determine if MSBUILD Arguments were executed for TFS Build Definition -


I am using Team Foundation Service 2012, with an internal controller, with a build controller, But I can deploy the app. I set up Build Definition, and am using my debug configuration, and provided the following MSBUILD arguments.

  / p: DeployOnBuild = true / p: Delay = True / p: depi ipspath_sites Odomadman "/ P: Username = No \ SVC-User / P: Password = Password / p: VisualStudioVersion = 11.0   

Fixes the solution, I do not get any warnings, or errors when If I go to my deployment server, then the application is empty.I have set up permissions for the Web application folder and the INStrv folder. I have also deployed / configured the web if I can not find any error, how can I tell What is going wrong in my deployment? I have already checked the event builder on both build servers and deployment servers, and there are no errors or warnings. I can also do a publication with my god machine And it works perfectly with the exact same criteria.

Both of these folders and their contents Copy from development environment to build server:

  C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v11.0 \ Web C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v11.0 \ WebApplications   

These folders are a dependency that is due to be published through Visual Studio 2012. This dependency is referenced in the .sln file.

Unfortunately this means that web deployment is silently unsuccessful.

Alternatively you can install Visual Studio on the Build server, but it will be a waste of a license.

VB.Net equivalent for Java Rijndael decryption method -


I have a working Java decryption function that is displayed below. The Java source code for RijndaelAlgorithm is the standard code that you see on the Internet - for example:

I try to reproduce this function using VB.Net I am doing I know. Net has supported Regentel, but I have not got a combination, which produces the same decrypted password under my Java code. It seems like a simple task, but I've already spent the day searching it.

Can anyone show me or send me sample code in VBnet which will produce equivalent function of Java function?

Here are my arguments:

  t = f8d44 ... cf22f8a 32 total characters key = [113,64,51,102,120 ... 98,98,108,115] 32 total bytes Keys = 32 public static string decrypt (string t, byte [] keyre, int size, ink blocksis): {stringbuffer plain = New string buffer (T. Langh ()); Byte [] textbits = resendell algorithm .get bites (t); Int cipherLen = textBytes.length; Object key = Resendell algorithm. Mekeke (set key length (key array, key sequence), key sequence); (Int offset = 0; offset & lt; cipher; offset + = block siege) {byte] plain bytes = resendal algorithm. Block decryption (textbights, offset, key, block siege); Plain .append (new string); } Return plain. Tosting (); }   

You can get some hints from the source code here: < / Div>

java - Request-Reply Database Model -


I'm thinking of simple database models based on the conversations of requests and replies. There may be only one answer in a request. Another request can be made on the basis of the previous answer. Required to be able to repeat all the history - from the request before the last reply. I have modeled a sample:

  request: Answer | Int id | | Int id | | Int Perid | | String text | | String text | | Integer answerID |   

How can I make it more useful by improving it?

I accept the request can generate more than one answer. Request ID request timestamp request text

Request ID is primary (clustering) key This is an automatic incremental integer Or taller.

You can also block a non-exclusive index on the requested timestamp.

  North ----- Answer ID Request ID North timestamp reply text   

Answer ID key primary (clustering) is an automatic incremental integer Or taller.

You also specify a non-unique index (request ID, answer timestamp descending). You can also define a non-unique index (north timestamp descending, request id). The first index is for all the replies of a request. The second index is for all the answers in a time period (week, month).

asp.net mvc - MVC HTML helper wrapper for jqPlot -


I want to make an MVC cover around jqPlot.

I have to make an assistant object to render to attract the required HTML container element and the necessary java script charts.

Something like this will appear:

  @ Html.jqPlot () .tartip (eChartTypes pie chart) .artdata (some data). Render Chart ();   

Now I am only in the initial design stage and I know that the JunkPlot object should be achieved in this way, the problem I have is with the Javascript which is the use of Jq Plot By emitting to attract the actual chart.

Suppose I will present the following script in my . Reader Chat () Method

  Public string RenderChart () {String chartcode = string.format (@ "& lt; script type =" text / javascript "src =" .. / Src / plugins / jqplot.canvasTextRenderer.min.js "& gt; & lt; / script & gt; & gt; script type =" text / javascript "src =" ../ src / plugins / jqplot.canvasAxisLabelRenderer.min .js "& gt; & lt; / script & gt; $ (document) .ready (function () {var plot1 = $ .jqplot ('{0}', [{1}]);});" This. Chartguide, this. Chart data); Return chart code; }   

The above is not the actual code, but only a general representation of the idea.

So the problem is that I do not want to throw helper to JS, leave the code in the HTML document body, except that I can not do it because becaus some necessary scripts html (best practice States may be as below).

Any suggestions? What would be the best way to emit a JS code using HTML Helper, then the situation is needed (like this one)?

I think, one would be possible solution to hear, in this case, the outline of the footer outline Or even finishing. That's why your code might give an event as an alternative to listening to an event and rendering it in that moment, but it is definitely dependent on the platform. I have also worked on a PHP cover, you can decoy it here: and have just implemented one assistant, but of course you can increase it :-)

Hope this Helps

Calling a batch from java requires to be started from the current batch file folder -


I am starting a batch file from my java program which will block some tokkat, the batch works only if it It will start from the command line but it does not work from starting Java, the problem is that the batch should not be called from the folder where it was continued continuously. So some files can not be found, my question is how can I switch to the folder where the batch is false and then start the batch so that it is running from its folder and get the required files < P> My code in batch folder c: \ foobar \ mybatch.cmd

for example is how the batch will be called by Java at present

  Public Zero Startbatch ( Path batch path) {if (batch path == empty) {new invalid records uppercase Throw ("Batch can not be started without path"); } If (! Files.exists (batchpath)) (new invalid unmatched findings ("batch is not present" + batch path. String ()); try {log.info ("batch initial" + batchpath.absolute path () ToString (); String command = "CMD.axa / c" + batchpath.assolute path () .tostring (); Process P; P = Runtime.getRuntime () .exec (command); p.waitFor (); Buffer Reader = New buffed reader (neweststream reader (PJet InputStream ()); String Line = Reader. Adlline (); while (line! = Null) {log.info (line); line = reader.readline ();}} grip (IOException e) {// TODO auto-generated cal block e.printStackTrace ();} Grip (Interrupted ejection) {// TODO auto-generated cache block e.printStackTrace ();} // Tudo auto generated method stub}    

You just cd: \ foobar \ in the batch file.

github - How to display the logcat of android emulator on travis-ci? -


I have found an Android project on GitHub which uses Travis-CI for continuous integration.

And I need to show the emulator lockket to get more information about the problem that occurs during automated build.

I tried to add both:

  after_failure: - adb logcat after_script: - adb logcat   

but both commands Is not executed.

It is probably due to the Travis-CI Java project that executes a mvn install command before the actual script is executed and both commands are not executed ... I Any help stuck in will be appreciated.

I think you do not need it already but I will try to answer the question.

You should add a - all flag otherwise these packages were not available.

Google has disapproved the -p --obuslete flag and is available only with the recommended (new) package - one-by-one flag. >

See

  resonant "y" | Android Update SDK - Filter Platform-Tools, Build-Tools-17.0.0, Android-16, Extra Android Support, $ ANDROID_SDKS - No-Uu - Force & gt; / Dev / Null Error: Unavailable Platform-Tools Error: Missing Platform-Tools Error: Unknown package filter ignores 'build-tools-17.0.0'   

Currently the latest platform -Tools are always suggested without - all flag but:

  $ / Android update sdk -u -t build-tools-17.0.0 Error: Ignore unknown package filter 'build-tools-17.0.0' Warning: package filter removed all packages. There is nothing to install. Please try updating again without package filter. $ ./android update sdk -a -u -t build-tools-17.0.0 Selected package to install: - Android SDK build-tools, modification 17   

Perhaps build-tool And the cause of the Android-17 platform

And I have seen a work for Travis-Lint, I do not use it.


This is the current work around I use for logs, needs improvement but works for the emulator, -e you have your MOD_NAME Custom is required.

  # adb -e: Direct an ADB command for the running emulator. If more than one error is returned before_script: # - echo 'LOGCAT' # LogLarket Check debug output: http://developer.android.com/tools/help/logcat.html # Check the debugging log: http: // developer Android.com/tools/debugging/ Debugging-log.html # Comment on lines to debug output and redirect it to a file Custom tags for your app - ADB-A Lockcat *: W | T logcat.log & gt; / Dev / null 2 ​​& gt; And 1 & amp; After_failure: # - Check the 'Failure' #ftc configuration: http://docs.travis-ci.com/user/ci-environment/#apt-configuration # To show login about testing with app name given below Comment on the lines on the Export section - sudo apt-get install -qq lynx - Export MOD_NAME = yourappmodulename - Export LOG_DIR = $ {TRAVIS_BUILD_DIR} / $ {MOD_NAME} / build / output / report / Android Tests / Connected / - Links - -Dup $ {LOG_DIR} com.android .builder.testing.Connectedevice.html & gt; MyconnectedDevice.log - Links --Dump $ {LOG_DIR} com.android.builder.testing.html & gt; MyTesting.log - * for file in .log; Do "echo $ $" file; Echo "====================="; Cat "$ file"; Done || Re: After_script: To kill #db, remove the line below and show logcat output - echo "LOGCAT"; Echo "========"; Cat logcat.log; I am looking for pre-installed options for  lynx  because  sudo Based framework is not being used and  cat  is actually included for files, if someone knows how to fix it, thanks.   

How insert a varchar ' / / ' as null on date column in PostgreSQL 9 -


I have a temporary table and want to insert data from another table, but temp In the date type, and column in usomultiple is a varchar .

If I try to convert using the to_date () function, I get an error because thousands of cells have been found to be '/ /' Was empty as the value.

ERROR: Price is not valid for an «/ A» «DDA»

  temporarily from INSERT (cd_id, ds_estado, Dt_date) Select um.cd_uso, um.ds_estado, to_date (um.dt_dateIn, 'dd / MM / yyyy') from our liberalities;   

How can I set the cell to poblated when the '/ /' and the correct value is set instead?

  TO_DATE (NULLIF (dt_dateIn, '//'), 'dd / MM / yyyy ')    

listbox - C# adding click events to a list box -


I am trying to add a list event to a list box, but for some reason nothing happens when I Click an item list box.

My guess and what I have read, the code should look something like this

  Private Zero list box1_Click (Object Sender, EventArgs E) {// Code Previous TextBox1 .Text = "success"; }   

This is not working though. Does anyone know how to be this?

If you want it, please do not worry about double click and other click variations. When you want to trigger 'click on items' in the box, why do not you try the selected Ink exchange instead?

client server - How do you import public key in C#? -


I can create asymmetric keys of both server and client and then I export them and try to exchange them . My problem is, and I can not find the solution, that is, I want to import the server's public key into the client program. It comes as a byte [], but I should be able to use it as an RSAParameters to be able to encrypt the data to go to the server. How do I change the byte [] to an RSAParameters type?

  Private Zero Safe ButtonNote (Object Sender, EventArgs e) {clientRSA = New RSACryptoServiceProvider (); Byte [] Client PublicKey = clientRSA.ExportCspBlob (wrong); Stm.Write (Client PublicKey, 0, clientPublicKey.Length); Stm.Read (serverPublicKey, 0, serverPublicKey.Length); }   

I know that this is not a "safe" way of doing this, because of weakness towards MITM, but I am running against a difficult school deadline and It's a brick before I can move forward, I need to come first.

Any help would be appreciated. thank you in advanced.

I will go ahead and answer it, then:

I have never done a bomb But whatever I usually do, I use RSACryptoServiceProvider.ToXMLString () to export to XML. Then I put that XML into my app in the resource and then put the RSACryptoServiceProvider.FromXMLString () key parameter back in the future use.

Do not let the public key be protected This is public

javascript - Web Worker Memory Leak? -


I'm using View to try to track some memory leaks in my page. I have got a special memory leak that results from getting instant web labor, I do not know how to get rid of it.

I have stripped the page to load the web worker. Do nothing else. Every time I refresh the page, the number of documents on the timeline view of Chrome increases permanently from 1 is. If I answer the call to the worker constructor, and start refreshing the page, the number of documents increases and then decreases, the effect remains the same. Manually finished / closing the worker does not solve this problem (though I can see that the worker disappears when I look at the tab of the Tools for Developer Tools).

Here's my trim. In the Htm file I am able to reproduce this issue with this small part of HTML / Javascript:

     

This is a memory leak in Chrome v25 It seems that Chrome is fixed in v26 Because this issue can not be made again.

wordpress - Why does our website load so much slower in IE than any other browser? -


We have a WordPress website that I have tried without leaving the IE browser. For IE, for some reason it seems that the browser loads every time the page loads for a few seconds, it can be doubled, if a page is to be loaded with the other page's iframe. The user has to wait a little while before doing anything on the page.

Someone has suggested that we can use WP SuperKatch to solve this issue, but I have problems in the past and I am reluctant to believe in this plugin, especially since it There is a problem in IE only.

What is the best way to prevent this problem? How can I find out which script is coming in the header, or footer etc.? Is there a quick way to do this, or do I need to end the variables within the theme?

I am not able to understand enough, but in IE9 push style CSS just below the page load order Being given - See Request # 35

Applying it as a browser until CSS renders this block.

On the other hand Chrome prefers priority download so that transport can be downloaded from resource images that can be blocked.

The two-loading side-by-side video experience here.

(If you want help looking forward to it, my contact details are in my profile)

algorithm - How to find all nodes in a graph equidistant from a given set of nodes? -


यदि आपके पास एक साधारण अप्रकाशित आलेख जी (वी, ई) और F < / कोड> जो V का एक सबसेट है आप कुछ नोड v को कैसे खोज सकते हैं कि F से v में प्रत्येक नोड से दूरी समान होती है और दूरी कम हो जाती है? और अगर कोई v नहीं है तो कोई भी वापस नहीं लौटें। मुझे बताया गया था कि यह ओ (| वी | | | ई |) में किया जा सकता है जटिलता।

मान लें कि सभी किनारों दूरी 1 हैं।

कोई भी यह समझाता है कि यह कैसे किया जा सकता है? एक छद्म कोड भी मददगार होगा।

समाधान बीएफएस के समान है, लेकिन थोड़ा बदलाव के साथ:

  1. एफ नोड्स के साथ एस = एफ चिह्नित करें।

  2. ढूंढें | एस | एस में प्रत्येक तत्व से दूरी 1 के साथ सेट करता है (इन सभी सेटों में अचिह्नित नोड होने चाहिए) यदि इन सेटों का अंतराल गैर-खाली है, तो उम्मीदवार पाया जाता है।

  3. एस | एस में ऊपर सेट और इन नोड्स को चिह्नित करें। यदि 'एस खाली है, तो' कोई नहीं 'लौटें

  4. चरण 2 पर लौटें।

    मान लीजिए कि सभी सेट ऑपरेशन लगातार समय लेते हैं, तो एल्गोरिथ्म की जटिलता है बीएफएस के समान है जो ओ (| वी | + | ई |) है

    अब सेट ऑपरेशन की जटिलता के बारे में सोचने के लिए। मेरा तर्क यह है कि सेट ऑपरेशन जटिलता को बढ़ाते नहीं हैं क्योंकि चरण 2 और 3 में यूनियन और चौराहे के संचालन के लिए समय ले लिया जा सकता है ओ (| एस |), और प्रत्येक चरण एस से पिछले एस पुनरावृत्तियों में एस से अलग है। , सेट परिचालन की समग्र जटिलता ओ (| वी |) होगी

C++ Conventions: this pointer -


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

  • 13 जवाब

    मुझे पता करने के लिए उत्सुक हूँ, क्या इस- & gt; के उपयोग के लिए एक सम्मेलन है सी ++ में? मैं आमतौर पर इस- & gt; इस बात पर जोर देने के लिए कि एक विधि और / या चर युक्त वर्ग का सदस्य है, लेकिन यह देखने में असमर्थ है, जो दृष्टिहीन है। यह उद्योग में अक्सर देखा जाने वाला किसी भी अन्य C ++ कोडिंग सम्मेलनों के बारे में जानना भी बढ़िया होगा, उदा। ऊंट मामले बनाम अंडरस्कोर, आदि।

    धन्यवाद!

    मैं पता करने के लिए उत्सुक हूँ, इस के उपयोग के लिए एक सम्मेलन है- & gt; में सी ++?

    मैं व्यक्तिगत रूप से इस से बच & gt; पॉइंटर जब भी संभव हो, लेकिन यह सिर्फ व्यक्तिगत वरीयता है।

    यह उद्योग में अक्सर देखा जाने वाला किसी भी अन्य C ++ कोडिंग सम्मेलनों के बारे में जानना अच्छा होगा, उदा। ऊंट मामले बनाम अंडरस्कोर आदि।

    कोडिंग सम्मेलनों को काफी हद तक भिन्नता है लेकिन एक उदाहरण Google का है।

    • ""
    • ""
    • "

      और, मेरी पसंदीदा:

      • " " < / html>

c# - using linq to get a single record from a table linked to another table -


This question is confusing because I do not know how to ask it.

Anyhow, I have 4 tables and I have to go to the tokensetting table to get a record. I have been given a codec and I have to travel from there and I need all the information. And because there are several corporate structures for each corporation, I must first obtain the structure of the corporation to be handed over to the token first.

Here's the layout:

Enter image details here < / P>

This is my code:

  _currentcorp = (from _entities.Comporations where c.CompanyCode == textBox_CompanyCode.Text selection C). FirstOrDefault (); If (_currentcorp == faucet) {errorProvider1.SetError (textBox_CompanyCode, "Invalid corporation."); Return; } Var corpstructure = (From the CS in _currentcorp. Corporation Structure where cs.District == zero & amp; cs.Branch == faucet & cs.Region == tap selection CS) .FirstOrDefault (); If (corpstructure == zero) {errorProvider1.SetError (textBox_CompanyCode, "Invalid corporation structure."); Return; } Var tokensetting = (From TS in _currentcorp.Tokens where ts.CorporationStructureId == corpstructure.CorporationStructureId ts.TokenSettings is selected) .FirstOrDefault ();   

The tokensetting is coming back in the form of ienumerable, even though I'm asking to get it first. I think it's saying that you meet first on tokens?

Anyhow, the tokenetting table should contain only 1 record, even if the table is many from 1 How do I return only this table for the first time?

==== Answer ====

As I have suggested, I have done the following:

 < Code> var tokensetting = (from TS in _currentcorp.T.CON) where ts.CorporationStructureId == corpstructure.CorporationStructureId is selected ts.TokenSettings.FirstOrDefault ()). FirstOrDefault ();    

I believe LINQ query is a IEnumerable Returning IEnumerables , then a second . First and last (default) you should get whatever you want.

The first call specifies that you want the first row in the result of the LINQ query, and the second specifies that you want the first element of the ts.TokenSettings , which is a The collection is.

java - basic bouncing ball in graphics window -


I am trying to create a simple animation that bounces a goole ball from the bottom of the graphics window and then Again I do not get out of the window until I get out of the window. The problem is that I do not understand how to get the ball to recognize the lower part of the graphics window and to put it on the other side. In other words, the ball never bounces from the floor, it just falls and eventually disappears under the screen. Is this the right approach to thinking about this problem, as long as I & lt; The ball should go down that step I do not understand what the situation should be to bowl the ball, and then again down again.

  Import acm.program. *; Import acm.graphics *; Public Class Bouncingball Graphics window {Public Zero Run) (Goal Ball Expands New Goal (0, 0, OVL_SIIS, OVL_SEGEE); ball.setFilled (right); add the ball; int dx = 0; Int dy = 1; while (true) {int i = 0; if (i & lt; STEPS) {ball.move (dx, dy); pausing (PAUSE_TIME);} if (??) {ball.move (dx, - Dy;; pauses (PAUSE_TIME);} I ++;}} Private Static Last STEPS = 1000; Private Stable Last OVAL_SIZE = 25; Private Stable Last PAUSE_TIME = 7;}    < P> 

you mean by instead of GraphicsProgram Is GraphicsWindow ? GraphicsProgram s is a getHeight () method that will tell you how long your window is. In this case:

  if (ball.getY) + ball.getHeight ()> = getHyight ()) {dy = -dy; }   

It goes down to the bottom of the screen when it reverses the y-velocity of the ball. If you want to bounce it back and forth then you can write the same code for the top of the screen.

Merge cell array of maps by key in Matlab -


Count (value) for the given event by looking at a cell array of

container.map ).

For example:

  map = {container.map ({'a', 'b'}, {1,2}), container. Map ({'b', 'c'}, {4,1})}; Merge Maps ans = Map (A -> 1, B -> 6, C -> 1)   

I can reach such a distance:

  maps = {...}; Res = container.map (); CMapC = map for cMap = cMapC {1}; CKeyC = cKey = cKeyC {1} for keys (cMap {1}); If hacks (race, ck) ridge (ck) = ridge (ck) + ciemax (ck); And ridge (ck) = cemap (ck); End of the end   

should work (untested), but whose "efficiency" and readability are least susceptible to say. What is a better solution?

Please note that there is currently no index for events, so it is cumbersome to use sparse matrix instead of map.

Not sure about readability, but it is probably more efficient:

  allKeys0 = cellfun (@keys, maps, 'uniformoptput', incorrect); [All, ~, m] = unique ([all keys 0:}]); AllValues0 = cellfun (@values, maps, 'uniformoputput', false); AllValues ​​= cell2mat ([allValues0 {:}]); Par = array (@ (x) amount (all values ​​(m == x)), 1: number (all of)); Merged map = container. Map (all of, par);    

c# - RichTextBox SelectionFont change back -


I am creating a rich textbox and I've got this code:

  richTextBox1.SelectionFont = New font ("Wordana", 10, font style. Regular); RichTextBox1.SelectionColor = Color.blue; RichTextBox1.Text + = "ddddd";   

The text remains the same I have seen that RichTextBox1.Text changes my font back to the default font. How can I fix this?

Try using the attribute method:

  rich textbox 1. Selection fonts = new font ("vardana", 10, font style. Regular); RichTextBox1.SelectionColor = Color.blue; RichTextBox1.AppendText ("ddddd"); RichTextBox1.SelectionFont = myDefaultFont; RichTextBox1. SelectionColor = myDefaultColor;    

php - Refresh page after form submiting -


My problem is I want to reload my page after submitting the form.

  & lt; Form method = "post" action = "" & gt; & Lt; Textarea cols = "30" rows = "4" name = "update" id = "update" max length = "200" & gt; & Lt; / Textarea & gt; & Lt; Br / & gt; & Lt; Input type = "submit" value = "update" id = "update_button" class = "update_button" /> & Lt; / Form & gt;    

only use

  echo "& lt; Meta Http-equiv = 'refresh' content = '0' & gt; "; For example, after encrypting   

)

  if (isset ($ _ POST ['submit'])) {SQL QUERY --- - echo "& lt; meta http-equiv = 'refresh' content = '0' & gt;"; }    

Java Arithmetic division -


  सार्वजनिक वर्ग परीक्षण {सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग [] args) {int total = 2; Int rn = 1; डबल आरएनपी = (आरएन / कुल) * 100; Println (RNP); }}   

यह 50.0 की बजाय 0.0 क्यों प्रिंट करता है?

विभाजन पूर्णांक अंतरिक्ष में भिन्नता के साथ कोई धारणा नहीं है, आपको आवश्यकता है कुछ ऐसा

  डबल आरएनपी = (आरएन / (डबल) कुल) * 100    

ios - Does assigning an autorelease object to a retained property increase its retain count? -


I would have thought 'self.data =' autorelease will maintain NSMutableArray objects and NSMutableDictionary objects include it but in the end I ExC_BAD_ACCESS gets when the cellForRowAtIndexPath method of the table tries to use NSDictionaries in self.data

  @property (strong, nonatomic) NSMutableArray * data; - (zero) updateReceivedData: (NSData *) jsonData {NSMutableArray * fetchedData = [NSJSONSerialization JSONObjectWithData: jsonData Option: NSJSONReadingMutableContainers Error: & amp; Error]; Self.data = [Self Convert Date: FermatedData Format: KMISXLadTime Format]; [Self.tableViewReloadData]; }} - (NSMutableArray *) convertDates: (NSMutableArray *) array withFormat: (NSString *) format {NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init]; [DateFormatter setDateFormat: format]; NSMutableArray * newArray = [NSMutableArray arrayWithArray: array]; For (in the NSMutableDictionary * newArray for dict) {id key in dict.allKeys} {if ([[dict objectForKey: key] isKindOfClass: [NSString class]]) {NSString * value = [dict objectForKey: key]; NSDT * date = [DateFormat Date: FrameString: Value]; If (date) [dict setObject: for date key: key]; }}} [DateFormatter release]; New araes; (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath:   

{Fixed NSString * CellIdentifier = @ "cell"; Customcell * cell = [tableview decouwer reusable cell with identifier: cell identifier]; If (cell == zero) {nslog (@ "cell was zero"); Cell = [[[Custom CL Alok] Inte] AutoEques]; } NSDictionary * dict = [[NSDictionary alloc] init]; If (_isfilter) {dict = [self.filteredData objectAtIndex: indexPath.row]; } Other {dict = [self.data objectAtIndex: indexPath.row]; } NSLog (@ "Filling Label 1"); Cell.IDLabel.text = [[Dict objectForcae: @ "id"] stringwheel]; NSLog (@ "Philing Label 2"); Cell.firstNameLabel.text = [dict objectForKey: @ "First name"]; [Core release]; Return cell; }

Turn on the corpse and see that this problem captures (EXC_BAD_ACCESS means Not necessarily a more released object, but it can be).

What happens with the full value of maintaining an object.

However, strong property means that the object is retained, yes, if you assign it via setter (i.e. self.data = ... and No _data = ...).

java - How to write TXT file to sdcard? -


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

  • 3 जवाब
      फ़ाइल पथ = Environment.getExternalStoragePublicDirectory (Environment.DIRECTORY_DOWNLOADS); फ़ाइल logfile = नया फ़ाइल (पथ, "andrometer.txt"); स्ट्रिंग [] असाइन एआरआर = नई स्ट्रिंग [7]; असाइनर [0] = अंतिम वैल्यू + "17"; AssignArr [1] = श्रेणी + "16"; AssignArr [2] = सक्रियमोड; If (assignArr.length & gt; 0) {try {if (path.canWrite ()) {FileWriter filewriter = new FileWriter (logfile); बुफ्डेड्रर आउट = नया बफ़ेड वाइटर (फ़िस्मराइटर); के लिए (इंट आई 1 = 0; आई 1 और लेफ्टिनेंट; असाइन एआरआर. लैंघ; आई 1 ++) {आउट.लिखित (असाइनर एआरआर [0] + "\ n"); आउट.लिखित (असाइन एआरआर [1] + "\ n"); आउट.लिखित (असाइनर एआरआर [2] + "\ n"); टोस्ट। मेकटेक्स्ट (एंड्रॉमीटर। इस, "आउट:" + असाइनर [2], टोस्ट। एलएनएनएचएच_एलओजी)। दिखाएं (); } Out.close (); }} कैच (आईओई एक्सप्शन ई) {लॉग.ई ("टैग", "फाइल नहीं लिखी जा सकी" + ई.जेट मेसेज ()); }};   

    यह कोड कुछ हफ़्ते पहले काम कर रहा था और अब मुझे ऐसा नहीं लगता है। मेरे पास स्पष्ट रूप से प्रकट होने की अनुमति है, मुझे विश्वास है, मैंने विशिष्ट फ़ोल्डर के बजाय जड़ को लिखने की कोशिश की, मैं चर नामों की जगह डमी डेटा के साथ परीक्षण कर रहा हूं। इस बिंदु पर कोई फ़ाइल नहीं बनाई जा रही है।

    लिखने की कोशिश करें:

      FileOutputStream fo = नया FileOutputStream ("/ sdcard / filename");    

automation - Using Python to Manipulate HTTP Headers -


So I'm trying to use Python to automate the 508 compliance check. There are a few hundred pages on our site, and at this time a person is actually going to the site every week and tries to enter all the URLs by hand. Below, the UIUC checks the request for the link referrer header and then returns the site's evaluation back. I can not really get a request to work, I have seen everyone through SO and whatever helps, can not get it. This code is bad, below and below the error message. Def fae (urltofae): opener = urllib2.build_opener () opener.addheaders = [('user-agent', 'mozilla / 5.0']] # [('Referrer': urltofae )] R = Opener. Open ('http://www.fae.cita.uiuc.edu/evaluate/link/') Print RFE ("http://www.example.com/")

More Error:

  File "", line 1, & lt; Module & gt; File "File: Library / Framework / Python.framework / Versions 7.3 / lib / python2.7 / urllib2.py", line 400, open response = self._open, in the file "& lt; stdin & gt; (File "/ Library / Framework / Python" / Library / Framework / Filename Framework / Version 7/3 / lib / python2.7 / urllib2.py ", line 418, _open '_open', in req) File Framework / Version / 7.3 / lib / python2.7 / urllib2.py ", line 378, _call_chain result =" / library / framework / Python.framework / versions / 7.3 / lib / python2.7 / Urlib2 in the result = func (* args) file. Py ", line 1207, http_open UrlRR (error) urllib2 in self.do_open (httplib.HTTPConnection, req) file "/ library / framework / Python.framework / version 7,3 / lib / python2.7 / urllib2.py", line 1177 in Do_open raise, .URLError: & lt; Urlopen error [error 8] Node name and pronoun has not been provided, or is not known & gt;   

And when I try to change the referrer header (instead of the user-agent), instead I get the formatting of errors instead of receiving the request, although the format is the same It is that he did not complain about user-agent.

I am still a new programmer, so if I am missing something redundant then I am very sorry, but I can think of everything I can. Thanks in advance, cheers.


OK, so I changed my strategy and it worked. Unfortunately, I do not know why the code given below was not worked out, and the above mentioned stuff kept me giving an error, but I have seen the same similar question (no specific answer) around Google, so I thought I should post it.

VLG, appreciate the help, Cheers.

  DFFAEEx2 (URLTFAA): R = URLB2. Request ('http://fae.cita.illinois.edu/evaluate/link/', header = {'user-agent': 'Mozilla / 5.0', 'referrer': urltofae}) c = urllib2.urlopen (r ) Print c.read ()    

I see no mistake there URL is correct?

instead of

'http://fae.cita.uiuc.edu/evaluate/link/' < / P>

Try using 'http://www.fae.cita.uiuc.edu/evaluate/link/'

Anywhere later Does not carry.

getting error in eclipse console saying fatal error -


I made some changes in my Java class in eclipses and found some errors and then I decided to fix those bugs. Can not run and this is giving me the following error and I do not know what to do with it Please help me before experiencing this error

  # # Java runtime Environment has received a serious error: # # Internal error (ClassFileParser.cpp: 3470), pid = 4716, tid = 8380 # Error: ShouldNotReachHere () # # JRE Version: 7.0-B147 # Java VM: Java Hotspot (TM) 64-bit server VM (21.0-B17 Mixed Mode Windows-MD-64 Compact Ops) Failed to write core # dump. ############################# If you would like to submit a bug report, please see: # http: ##: /bugreport.sun.com/bugreport/crash.jsp #    

I can not Explain it here See here for reference



Prolog difference list - mergesort -


I must write a predicate that will divide a list into two lists (on half):

  Partial (XY, XZ, ZY): - halve_pom (XY, XY, Z),! Halve_pom (Z-Y, Y-Y, Z) Halve_pom ([_ | A] -Y, [_, _ | B] -Y, Z): - halve_pom (A-Y, B-Y, Z).   

It was easy, but now I have to type the algorithm which will merge - I have no idea. This algorithm should use the difference list.

Please help. No, it was not "easy" because it does not work, unfortunately

Halva ([1,2,3] - [], A, B) does not work; halve_pom ([1,2,3] - [], A, B) does not work either. Apart from this, it is not clear what splashing schemes you like, [1,2,3,4,5,6,7] - & gt; ([1,3,5,7], [2,4,6]) or - & gt; ([1,2,3,4], [5,6,7]) .

If your half works in the works, then you have to define merge to do whatever you have left, which are two parts of the list Mergeresort (A, S): - Halva (A, B - [], C- []), MergeRort (B, SB), Merger (C, SC), Merge (SB, Scheduled Castes, S []).

Note that you might call it with the normal list A , that is, half predicate your first argument to a general list (I.e. not the difference list).

Also see. '-' is unnecessary; Instead, two components of it should be used as two different arguments of an ingenious.


Therefore, a method of code is halve

  half ([A, B | C], [A | X] -JX, [BY] - Jiayu): - Half (C, X-ZX, Wi-YE). Half ([One], [X | X] -X, Y-Y). Half ([], X-X, Y-Y).   

The same approach can be used for code merge :

  merge (SB, SC, SZ): - SB = [A | B], SC = [C | D], A = & lt; C, S = [A | T], merge (B, SC, TZ). Merge (SB, SC, S-Z): - SB = [A | B], SC = [C | D], A & gt; C, ..., .... Merge (SB, SC, S-Z): - SB = [A | B], SC = [], ..., .... Merge (SB, SC, S-Z): - SB = [], SC = [C | D], S = [C | T], .... Merge ([], [], Z-Z).    

Byte code and Source code in Java? -


I'm really confused which of the following has some help in answering the source code and byte code in Java code do?

  • Student.class
  • Students
  • Students.Java
  • Student.exe

    Student. Java is a Java source code file, a text file

    Student .class is a compiled bytecode, a binary file

    Student.exe is a Windows executable (also has binary, but)

    Student is not a file at all, just an abstract concept (a Java class, whose full name will be something like com.vicheanak.myapp.Student ).

    You can also face Student.jar which is a collection of all class files and other resources that make applications or libraries.

  • mysql - count the number of rows between intervals -


    मेरी टेबल समान है:

      + --------- + --------- + ------------ + ----------------------- + --- ------------------ + | VisitId | UserId | स्थान आईडी | टिप्पणियाँ | समय | + --------- + --------- + ------------ + ---------------- ------- + --------------------- + | 1 | 3 | 12 | यह एक अच्छा दिन है! | 2012-12-12 11:50:12 | + --------- + --------- + ------------ + ---------------- ------- + --------------------- + | 2 | 3 | 23 | बहुत सुंदर | 2012-12-12 12:50:12 | + --------- + --------- + ------------ + ---------------- ------- + --------------------- + | 3 | 3 | 52 | अच्छा | 2012-12-12 13:50:12 | + --------- + --------- + ------------ + ---------------- ------- + --------------------- +   

    जो रिकॉर्ड करता है विज़िटर 'प्रक्षेपवक्र और स्थानों पर कुछ टिप्पणियां

    मुझे कुछ आगंतुकों की गिनती करना है जो किसी विशिष्ट स्थान पर (0 = 2327) कहते हैं 0:00 से 23:59 तक, कुछ अंतराल पर ( यानी 30 एमिन)

    मैं ऐसा करने का प्रयास कर रहा था :

      SELECT COUNT (*) से यात्रा समूह द्वारा घंटे (समय), साइन इन करें (मिनट (समय) - 30) // यदि वे एक ही अंतराल में हैं तो यह एक ही परिणाम देगा WHERE locationId = 3227   

    समस्या यह है कि अगर कुछ अंतराल पर गिरने वाला कोई रिकॉर्ड नहीं होता है, तो यह गिनती 0 के साथ वह अंतराल वापस नहीं लौटाएगा। उदाहरण के लिए, 02:00 से 03:00 तक स्थान पर जाने वाले कोई भी आगंतुक नहीं हैं, यह मुझे 02 के अंतराल नहीं देगा: 00-02: 29 और 02: 30-2: 59।

    मुझे सटीक आकार के 48 के साथ एक परिणाम चाहिए (प्रत्येक आधे घंटे के लिए), मैं कैसे कर सकता हूं यह?

    आपको 48 पंक्तियाँ जो आप चाहते हैं के साथ एक टेबल बनाते हैं और बाएं बाहरी जुड़ने का उपयोग करें:

      select n.hr, n .hr, कोलासेस (v.cnt, 0) से सीएनटी के रूप में (0 के रूप में एचआर चुनें, -1 के रूप में चयन करें संघ सभी संघ चुनें 1, 1 संघ सभी चुनिंदा 1, 1 संघ सभी का चयन 1, 1 संघ सभी। । । चयन 23, 1 संघ सभी का चयन 23, 1 संघ सभी) बाएं बाहरी छोड़ें (घंटा का चयन करें HOUR के रूप में (समय), हस्ताक्षर (मिनट (समय) - 30) हस्ताक्षर के रूप में, COUNT (*) विज़िट्स से सीएनटी के रूप में स्थान स्थान = 3227 ग्रोथ बाय एचओआर (समय), साइन (मिनिट (समय) - 30)) v.h पर n.hr = v.hr और n.sign = v.sign आदेश n.hr, n.hr    

    python - Returning from __len__() when >64 bits -


    In this problem, I am working with IPv6 network address spaces, therefore the length is 2 ^ (128 - subnet) .

    It appears that the dragon (at least on this machine) will face a 64 bit signed number from __en () lane (IP ('2001 :: / 66')) works , but lane fails (IP ('2001 :: / 65')) . From the IPI import IP lane (IP ('2001 :: / 64')) Traceback (most recent call final): File "test.py", line 2, & lt; Module & gt; To convert overflow error: int int

    to LAN (IP ('2001 :: / 64')), long int is too large to be questioned on the IPy library.

    Any suggestions on how to handle it, or the sign that it might be a limitation? I

    The issue you're killing is that one of the containers in the Python's C API There is a system-dependent limit. That is, the C function PyObject_Size returns a Py_ssize_t value, which is a signed version of standard C size_t type. This size is dependent on the system, but 32-bit systems have 64 bits on 32 bits and 64-bit systems.

    The builtin len function is used by PyObject_Size , so it has its own limitations here: Fixed PyObject * Builtin_len (PyObject * self, PyObject * v) {Py_ssize_t res; Res = PyObject_Size (v); If (RAS & lt; 0 & amp; amp; amp;; PyErr_Occurred ()) return; Return PIINT_From SSIID_T (RAC); }

    Instead of calling builtin you work around this limit using the len method on the IP object You can. Len :

      IP ('2001 :: / 64'). Len ()   

    This is a pure python, so this is no limit on the integer shape.

    java - How to update inmediately shared variables between threads -


    My exam program asks a string and prints every 2 seconds. I have already read about some Java memory models or do not update their variables immediately on threads main memory.

    I have tried unstable and static attributes while synchronizing the code blocks in which the variable line was modified. With waiting () / notice () when the variable was changed and some other how do I specify the line as a reference and not in the form of value? Am I trying to do wrong? Why objects can be completely synchronized when they work as monitors but they can not be while working as pointers?

      Public Class TestSharedVariable {static String line = ""; Public Stable Zero Main (String [] Args) {// Scanner Keyboard to read from Keyboard = New Scanner (System.in); Printer p = new printer (line); P.start (); // reads a row in the variable shared with the keyboard, while (! Line.equals ("quit") {line = keyboard.nextLine (); }}} Class printer thread {personal volatile string line; Public printer (string palabra) {this.line = palabra; } / * Line every 2 seconds * / @ override public wide run (while (line! Axles ("left")) {try {sleep (2000); } Grip (Interrupted predefined e) {e.printStackTrace ();} System.out.println (this.getName () + ":" + line); }}}   

    Output:

      thread-0: asdf thread-0: thread-0:    
    • One of the two main issues are: The position of a string variable, such as the characters that are included in it, has been created once, and
    • You are specifying two reference variables in the same object, but your assignment of a version Hoping to change Scope changes assignment of other variables, and not how Java reference variables it.

      In other words, although initially you are setting the line variable of the printer object in the same context as the TestSharedVariable static line variable, by changing the context of the Static Line variable of TestShared Vonable, the printer line Variables will not have any effect on reference assignments. To understand the threading, do not do anything with threading and everything to do. Think about reference variables such as pointer in C or other similar languages. If two variables point to the same object, then a variable is assigned to a different object But there is no effect on the first variables to point out.

      In order for your code to work, both variables must share the context of the same mutable object, and you have to change the state of the changable object, not Reference for this.

      For example,

        import java.util.Scanner; Public Class TestShirewareble {stable volatile MutableObject mutableObject = New MutableObject (); Public Stable Zero Main (String [] Args) {// Scanner Keyboard to read from Keyboard = New Scanner (System.in); Printer P = new printer (mutableObject); New thread (P, "Print thread") Start (); // reads a share from the keyboard in the shared variable, while (! MutableObject.getData (.) Equals ("leave")) {mutableObject.setData (keyboard.nextLine ()); }}} Class Printer executes Runnable {Personal Volatile MutableObject mutableObject; Public printer (MutableObject mutableObject) {this.mutableObject = mutableObject; } / * Over 2 seconds * / / Override public is run () (while! MutableObject.getData (.) Equals ("left")) {try {Thread.sleep (2000);} Hold (Interrupted e) {E.printStackTrace ();} Thread Thread = Thread.WrenchTrade (); System.out.println (thread.getName () + ":" + variable object);}}} class MutableObject {Private string data = ""; Public string getData () {return data;} public zeros set data (string data) {this.data = data;} @ override public string to string () {return data;}}    

    ios - Cocoa Static Library with ZXing error -


    My project uses some cocoa stabilizing libraries, one of which is the Zaxing project I try to include this project Time I'm getting a lot of errors, oddly enough, I was able to create a demo in a separate project with no zodiac error. My main project creates and runs OK, as long as I have a position for ZXing cocoa The library is not included.

    So the question is, how do I include ZXing static library for my Cocoa project? How do I configure a library (like how do I set the Find Path Path ~~).

    Thank you.

    In some detail about your project

    structure

    EnjoyMobile -CustomStaticLibrary.xcodeproj -ZXingWidegt.xcodeproj

    My -CustomStaticLibrary target Header search path in ./zxing/iphone/ZXingWidget/Classes ./zxing/cpp/core/src

    error

      Undefined symbol for architecture i386:   

    Zaxing is a painful integration, even in new versions of Exodus, The inquiry is registered. I suggest you use a better integration or cococaps for this purpose casing.

    javascript does not work in IE and Firefox after jquery 1.8.3 upgrade -


    I have updated from jquery 1.7 to jquery 1.8.3 (everything is fine in all browsers), but I got a javascript Which requires 1.8.2 or 1.8.3, zinc 1.

    Now the JavaScript image size changes on this page, Chrome does not work in IE 10 and Firefox, and it does not work correctly Image resizes.

    There are no JavaScript errors in Firefox, so I do not know what the problem is.

    HTML1513: Extra " "Tag found. Each document should contain only one " gt; " tag.
    Albert-Einstein-physicist-with-the-rules-of-game-and-so-your-pass, line 9-character5

    HTML1513: Extra " gt "tag found. Each document should contain only one " gt; " tag.
    Albert-Einstein-physicist-in-the-rules-of-game-and-so-you have, line 11 character 9

    HTML1517: Invalid nesting victim " and gt; " tags should not be placed within any other "

    ".
    Albert-Einstein-physicist-to-you-learning-game-and-so-about-your-pass, line 120 character 41

    HTML1508: mismatched end tag.
    Albert-Einstein-physicist-you-is-games-and-so-your ------------- learn-to-learn, line 125 character 41

    HTML1409: Invalid attribute name character attribute names should not contain names ("), ('), (& lt;), or (=).
    Albert-Einstein-physicist-with-learning-of- And-so-you have, line 24 9 characters 55

    They probably do not help. But anyway, it seems that whatever you have to do, it is max -width / min-width images are only width: 100% . < / P>

    python - changing type of a entry in dictionary throws error -


      डी = {'आज': datetime.today ()} d ['today'] = str (d) .today) # अटूट एंटर: 'डिक्ट' ऑब्जेक्ट में कोई विशेषता नहीं है 'आज'   

    अजगर सांत्वना के साथ खेलना मुझे पता चला कि आप ऊपर नहीं कर सकते ऐसा क्यों है?

    जैसा कि यह कह रहा है कि आपके पास 'आज' संपत्ति नहीं है - 'आज' केवल शब्दकोश की एक कुंजी है अपना कोड बदलें:

      d = {'today': datetime.today ()} d ['today'] = d ['आज']। Strftime (& lt; आपके प्रारूप & gt;) < / कोड>   

    Get local IP address of the PC in Android -


    I am running some android code in Android emulator on PC. I want to get the local IP address of the PC in my Android code, it is not sure that this is possible ...

    I have checked the following post but it seems that it is only public IP The address of the PC can be given.

    Thank you.

    Normally an Android device or emulator should be thought of as a separate computer from your development computer Could.

    He said that if you want to connect to a local computer with an Android emulator / device, here are 2 options for you.

    >

  • Use an internal DNS that indicates a name on your local PC, you can also use it to override the "live" url, if it is the same Which you want.

  • Use the BuildConfig.DEBUG flag or similar mechanisms to switch between live and debug URLs / resources

    For example, when I test, to switch between a live URL for exporting and debugging:

      Public Final Class MyAppConstants {// for all requests of public APIs} Url support; My API public static final string BASE_URL; // Auto-switch between LIVE and debug URLs based on usage STECTIVE {if (buildconfig.deview) {URL_BASE = "http://debug.server.com/"; } And {URL_BASE = "http://live.server.com/"; }}}    

  • Python 3.3 can't seem to find the decoder module in pocketsphinx library -


    I get the error AttributeError:. 'Module' object has no attribute 'decoder' I have the following code I am using because there was no setup.py file so I DLS in your own folders and libraries manually dragon moved 33 Directory Had done it. (Library files in Lib and DLL in DLL) I am able to import Pocketfinds and Spinxbase modules without error. Any help would be appreciated.

      import pocketsphinx import sphinxbase LMD = "C: \ Python33 \ Lib \ site-packages \ pocketsphinx \ models \ LM \ HUB4_trigram_lm \ language_model.arpaformat" HMD = "C: \ Python33 \ Lib \ site-packages \ Pocketsphinx \ models \ hm \ en_US "dictd =" C: \ Python33 \ Lib \ site-packages \ Pocketsphinx \ models \ lM \ HUB4_trigram_lm \ language_model.vocabulary "FH = open ( 'test1.wav' , 'rb') fh.seek (44) decoder = pocketsphinx.Decoder (hmmd, LMD, dictp) nsamp = Decoder.decode_raw (FH) Hyp, uttid, score = decoder.get_hyp () print ( "Got result + Hyp + 'score' + points)    

    nsamp = Decoder.decode_raw ( FH)

    This Issa must be decoder.decode_raw (fh) . You are trying to see the decoder in the default module instead of the method in the object.

    ios - NSString URL decode? -


    I have tried many approaches, but this small string URL can not be decoded. NSString * was decoded; NSString * encoded = "field = id% 2CdeviceToken"; Decoded = (__breeze nssting *) CFURL creation stringbearingplanspercent scapeupping encoding (null, (CF stringerf) encoded, null, NSTF 8 string encoding); NSLog (@ "decoded string% @", decoded);

    The same (!) Logs the string after saving percentage from the above code.

    Is there a reliable solution? I think some types of RegEx solutions can work on the basis of some documents. instead of use CFSTR ("")

    from:

    characters touched escape

    whose percentage escape sequence, such as% 20 for space characters, you want to leave intact Are there. To specify that no percentage of migrating is replaced by the zero pass, or the empty string (CFSTR ("")) to specify that all will be replaced.

      NSString * encoding = @ "fields = id% 2CdeviceToken"; NSString * decode = (__bridge_transfer NSString *) CFURLCreateStringByReplacingPercentEscapesUsingEncoding (zero, CFStringRef) encoding, CFSTR (""), kCFStringEncodingUTF8); NSLog (@ "decoded string% @", decoded);   

    Prints:

    2013-03-26 21: 48: 52.559 URLDecoding [28794: 303] decodedString areas = ida ??, a ?? ¬ Device Tokens

    8051 - Setup Xcode for using external compiler -


    I am trying to use the encode as an editor for the microcontroller code. I want to use build, run buttons, how can I use them to trigger a script compiling the program? I already have a script which works on the command line. I have to pass some criteria, like file name and maybe some options I am using SDCC which is a 8501 compiler What is a custom target in Xcode Or is it possible to create something, so that he calls the script and sends the file name or parameter? Any examples on how to do this? Of course I can not use GCC for this.

    Good, you get the "external build system" project:

    • - & gt; New - & gt; Project - & gt; OS X - & gt; External Build System - & gt;
    • Set "/ bin / bash" in the "Build Tools" field
    • Set up other information and create projects
    • Select your target and select "Info" tab Set logic (given on the name of your script and the argument script) and the work directory (if necessary) you can change the construction tools here.

      If you want to set a different script as a run command than:

      • Click below on your current plan and "plan Edit ... "Select
      • Select" Run "in the left panel
      • Click the" Info "tab: Select" Executable "- & gt; "Other ..." - & gt; Navigate to the / bin directory (Command + Shift + G) - & gt; Select "Bash" to set "Debugger" in "None"
      • "Logic" tab: set logic (your script and argument have to be passed)
      • "Options" tab: Set up the work directory.

        I usually use only one script (set as run script) in this case just leave the argument on the "info" tab of the target.

        Edit : There is no need to pass any of the arguments to make a creation tool, just set the directory appropriately and find out there the makefile .

    php - Pass value from one page to another using jQuery -


    I have a simple script setup that can be used in jQuery using values ​​from one value to another Is stored. When the link is clicked, the value of the array should be sent to the community.php page, but it is not working and I am not sure how to draw any advice on the community page?

    JQUERY

      $ ("# subscribe_link"). Click (function () {$ .post ("community.php", {'options []': ["John", "Susan"]})});   

    PHP

      print_r ($ option);  

    In fact, you can send an array like this. The problem is that you post There is a need to access the data made and make the first variable of any php execution.

      $ ("# subscribe_link"). Click (function () {$ .post ("community.php", {'choices []': ["John", "Susan"]})}}   

    comunity .php: $ option = $ _POST ['option']; print_r ($ option);

    Unless you have data with the requested data Your AJAX request will not be able to do anything: Therefore, you must have $ .post ():

      $ ('#btn'). Click (function () {$. Post ("community.php", {'choices []': ["Jon", "Susan"]}, function (data) {warning (data);});});    

    android - Not able to Dismiss the AlertDialog when pressing Menu key second time -


    Here I am showing a AlertDialog by pressing a menu key and displaying its popup dialog But when I'm trying to , pressing the menu key again for another does not trigger the menu key .

    Here is my code for this

      @SuppressLint ({"NewApi", "NewApi", "NewApi", "NewApi"}) @Override Public Boolean OnKeyDown (Integer keycode, keyEvent event) {AlertDialog.Builder alertDialogBuilder = New AlertDialog.Builder (reference); If (keycode == KeyEvent.KEYCODE_MENU and event.getAction () == 0) {if (open!) {ShowDialogItem (); Open = true} Else if (open) {alertDialog.dismiss (open = false;} return true;} super.onKeyDown Return (keycode, event);} Public Zero showDialogItem () {AlertDialog.Builder alertDialogBuilder = New AlertDialog.Builder Reference); Vigilant DLObuilder.setItems (R.ra.Salt_LiOG_Intems, New Dialogue Interface.OnclickList () {click on Public Zero (Dialogue Interface Dialog, Int J) {String [] items = Reset (). GetStringArray (R. Night.Salte_pilog_iites); New AlertDialog. Builder (MainActivity.this ) .setMessage ("you selected:" + + [which]] .show ();}}); alertDialog = alertDialogBuilder.create (); WindowManager.LayoutParams LP = new WindowManager. LayoutParams (); LP = alertDialog.getWindow () getAttributes (); lp.gravity = Gravity.TOP | Gravity.LEFT ;. lp.x = -300; lp.gravity = Gravity.BOTTOM; alertDialog.getWindow () SetAttributes. (LP); Sarkshmilog.show (); AlertDialog.GateVundo () Set Layout (130, 220);}    

      got started this started public static x = 0; Public boolean OnKeyDown (int keycode, KeyEvent event) {if (keycode == KeyEvent.KEYCODE_MENU & amp; & amp; event.getAction () == 0) {AlertDialog.Builder builder = new AlertDialogkBuilder (it) KsetOnKeyListener ( new DialogInterface .OnKeyListener () {@Override public boolean onKey (DialogInterface dialog, int keycode, KeyEvent event) {if (keycode == KeyEvent.KEYCODE_MENU & amp; & amp; event.getAction () == 0) {if (x == 1) {Alert.dismiss (); x = 0;} Veracity back;} return false;}}); If (x == 0) {builder.setmesge ("login details changed successfully ..."); Builder. Set reject (true); Builder.setPositiveButton ("OK", New DialogInterface.OnClickListener () {Click Public Zero (DialogInterface Dialog, Ent ID) {System.exit (0);}}); Alert = builder.create (); Alert.show (); X = 1; } Back true; }    

    java - Setting up JMF in Windows 7 64 bit -


    I searched high and low to learn how to do this stupid thing I downloaded, and for JMF Run Windows Installer, and set my PATH and CLASSPATH environment variable to:

    Note that this is subject to user variable for administrator ( My user account name), not system variable

      CLASSPATH C: \ Program Files (x86) \ jmf2.1.1e \ lib \ jmf.jar; C: \ Program Files (X86) \ JMF2.1.1e \ lib \ sound.jar ;;% CLASSPATH% Path C: \ Program Files (x86) \ JMF2.1.1e \ lib;% PATH%  < However, whenever I'm going to use the  JMFDiagnostic  tool applet on the Oracle website, it still crashes with an error about me that I do not have the right class Additionally, when I go to Netbeans 7.3 and try to import a package, then it says that it does not exist.  

    Can anyone help a brother !? I have spent a lot of time working on it!

    Try to open JMF and re-install it in C: \ JMF2.1.1e \

    Full step to install JMF on win 7:

    NB: When JMF is not completely eliminated, do not forget to designate the environment variable CLASSPATH user Variable (if it does not remove automatically).

    testng - How to congigure log4j property file to print only Listener class logs in the Console? -


    I am using listener which is shown below to log in for testgag tests only in the console The listener wants to print the log and go to the full log shawl fulllog file. The full logs are going on the full log file, but getting both the full log and the listener class log in the console is getting both.

    Listener Category:

      SimpleListener applies to the public class ITestListener {Private Static Logger m_log = Logger.getLogger (SimpleListener.class); Finish on public zero (ITestContext itestcontext) {m_log.info (called "onFinish ()"); } Start at Public Zero (ITestContext itestcontext) {m_log.info (called "onStart ()"); }}   

    My log4j property file:

      log4j.rootLogger = INFO, FullLogAppender, ConsoleAppender log4j.logger.TestLog = information, BreakPointAppender #Console log Apader Log4j.appender.ConsoleAppender.layout = org.apache.log4j.PatternLayout log4j.appender.ConsoleAppender = org.apache.log4j.ConsoleAppender log 4j.appender.ConsoleAppender.layout.ConversionPattern =% d {ABSOLUTE}% 5p% c {1 }:% L -% m% n log4j.appender.ConsoleAppender.Target = System.out # full log Apader log4j.appender.FullLogAppender.layout = org.apache.log4j.PatternLayout log 4 j.appender.FullLogAppender.File = mfgLogs / FullLogs / FullLog.log log4j.appender.FullLogAppender = org.apache.log4j.RollingFileAppender log4j.appender.FullLogAppender.layout.ConversionPattern =% d% -5p% c% x-% M% N log4j.appender.FullLogAppender.Append = false December 12 12:41:11 2012   

    expected results in the console:

      11: 29: 33,159 information simple Listnr: 15 - Onstart () 11: 29: 50,372 information simple Listnr: 31 - Rntast. ... 11: 30: 23,6 37 Information Simple Listener: 23 - Failed 11: 30: 24,402 Information Simple Listener: 12 - Onfinish ()    

    < Div class = "post-text" itemprop = "text"

  • Add a logger to your listener

      log4j.logger.xxxx.SimpleListener = INFO, ConsoleAppender     

    Xxxx SimpleListener is fully qualified for your audience Rg will be named;

    • If you do not want the listener's log to appear in the full log file, then set the additivity for the false

        log4j.additivity. Xxxx.SimpleListener = false      

  • Correct way to modify maven plugin configuration from mojo -


    I know that this is subjective question and it will most likely stop but I do not know to get an answer to this question. To where is it from

    There is a small problem with the Maven Android plugin - it modifies the original manifest file, and if you are running Maven in the Tasks folder, then your VCS is offering you these changes. .

    Example: If I create a build with the beta environment, then we have many environments to run, it will modify the app name in AndroidManifest.xml .

    It can be easily solved by imitating the copy and reference of the copy can refer to the Android maven plugin. But I have decided to make it easier for the developer so that the plugin will do this by leaving the situation automatically when the developer specifies that he wants to make this update under the original manifest.

    Modifying this functionality was easy to replace and replace the file that resides in the context of the file) The problem is that I need to pass this property to other mojos.

    Abstract Mojo AbstractAndroidMojo T execute is the method and all other mojos extend this class. Definition looks like this:

      / ** * & lt; Code & gt; AndroidManifest.xml & lt; / Code & gt; File. * * @ Parameter default-value = "$ {project.basedir} /AndroidManifest.xml" * / protected file androidManifestFile;   

    I followed it:

      Private Zero Update Plugin Configuration (string newmapfile value) {for (plugin plugin: project.getBuild (). GetPlugins ( )) {If (Plugin.getArtifactId (.) Equals ("android-maven-plugin")) {Xpp3Dom Configuration = (Xpp3Dom) plugin.getConfiguration (); Xpp3Dom manifestFileParameter = Configuration .getChild ("androidManifestFile"); If (manifestFileParameter == faucet) {manifestFileParameter = New Xpp3Dom ("Android Manifest File"); Configuration.addChild (manifestFileParameter); } ManifestFileParameter.setValue (newManifestFileValue); break; }}}   

    But unfortunately it does not work. There are many clear ways to do this work but all of them have to change all the current moons.

    I wonder if someone knows why the answer does not work or how it works.

    The update plugin's code can be found here:

    Thanks to everyone who has been reading till the end.

    Are you running your goal within the same lifecycle phase? If not, then it has been written in your written post:

    Note: Any configuration changes are discarded at the end of the current stage.

    Another thing to consider: Do you expect that targets are goals? Take a look at this post: - It's probably the order of those plugins that you have problems with.

    Consider other things: Perhaps you prefer cleaner solutions - adding this feature to Android-maven-plugin? Manfred Moser is usually open for proposals supported by pull requests;)

    The difference I'm most likely doing the same thing in my plugin is the only difference that I copy the dependency within my custom plugin lifecycle To re-use the target from the Maven-dependency-plugin. I am trying to create a plugin for the InstallShield project building.

    get errors after git pull -


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

    • 4 जवाब

      मैंने कोशिश की "git पुल "एक रेपो से, मुझे यह कहने में कोई त्रुटि मिलती है, खींचें संभव नहीं है क्योंकि आपने फ़ाइलें अनारंपित कर दी हैं, लेकिन मैंने वेब पर कुछ खोज की," जीआईटी पुल = जीआईटी लाने + जीआईटी मर्ज ", है ना? / p>

      मैं इस्तेमाल किया Git पुल, तो मैं निम्न संदेश

        यू विधानसभा-CSharp.pidb यू विधानसभा-UnityScript.pidb एम आस्तियों / testing.unity यू लाइब्रेरी / assetDatabase3 यू मिल अस्थायी / Undo55e9beda8401848509d9e3bb5d5fe513 यू अस्थायी / Undof0c17c0ba33904b16a1698563ff5302c यू अस्थायी / __ EditModeScene यू wiisummoner-csharp.sln यू wiisummoner.sln पुल संभव नहीं है क्योंकि आप मर्ज ना किए गए फ़ाइलें है। कृपया, काम के पेड़ में उन्हें ठीक करें, और फिर 'git add / rm & lt; file & gt;' का उपयोग करें रिज़ॉल्यूशन को चिह्नित करने के लिए उपयुक्त है, या 'git commit -a' का उपयोग करें उपरोक्त त्रुटि संदेश है, फिर मैंने "जीआईटी मर्ज" की कोशिश की, मुझे एक त्रुटि मिलती है "मर्ज संभव नहीं है क्योंकि आपने फ़ाइलें अनारोल्ड कर दी हैं"। यह बहुत भ्रमित है..किसी को भी पता है कि समस्या क्या है? मैं चाहता हूं कि सभी सिर्फ रेपो से खींचें।   

      जैसा कि आप कहते हैं, "git pull" Git ", क्योंकि यह एक करना होगा" + Git मर्ज "।

      यदि आप एक नहीं कर सकते हैं" Git मर्ज ", यह तार्किक इस प्रकार है कि आप एक ऐसा नहीं कर सकते" Git खींच लाने Git मर्ज "में प्रक्रिया।

      आपके पास टेम्प में आपकी अपनी फ़ाइलें हैं, या आपकी स्थानीय * .पिड फाइल पहले से मौजूद हो सकती हैं और अपस्ट्रीम शाखा के साथ संघर्ष हो सकती है।

      इन फ़ाइलों को संस्करण नियंत्रण में डाल कर सिर्फ परेशानी के लिए पूछना, जब तक कि आप इन फाइलों में अंतर करने के लिए संस्करण (संस्करण) नहीं चाहते हैं (और आप वास्तव में नहीं ...), मेरा सुझाव है कि आप अपस्ट्रीम परिवर्तनों को अस्वीकार करते हैं और उन्हें ठीक करने के लिए कहें।

      संयोग से,

        $ Git --version Git संस्करण 1.7.12.4 (एप्पल Git-: रिकार्ड के लिए, इस Git पुल का पूरा उत्पादन दिखता है, जैसे मैं प्रदर्शित करने के लिए एक साधारण परीक्षण भंडार बना दिया है 37) $ git पुल अद्यतन e78f298..3067a12 त्रुटि: निम्नलिखित अनचाहे काम कर रहे ट्री फ़ाइलों को मर्ज द्वारा ओवरराइट किया जाएगा : तीन। Txt कृपया विलय करने से पहले उन्हें स्थानांतरित या निकालें। Aborting   

      इस मामले में, इसका उत्तर बहुत सरल है:

      • कहीं और तीन स्थानांतरित करें।
      • git pull

        करें, तो अगर आपका संस्करण 'Three.txt' का महत्वपूर्ण था, इसके अतिरिक्त प्रदर्शन:

        • वापस तीन। (आप git छिपाने की जगह किया था, तो शायद तुम कर सकते हो git छिपाने की जगह पॉप
        • मतभेद सही करने का प्रयास है, ताकि आप सिर्फ अनाड़ीपन से अधिलेखित नहीं कर रहे हैं अन्य व्यक्ति के परिवर्तन।
        • नए परिवर्तनों को तैयार करें।

    mysql - What is the rank of the rating in which maximum movies fell into? -


    हाय मेरे पास निम्न डेटा मॉडल है।

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

    मुझे उस रेटिंग के रैंक को खोजना होगा जिसमें अधिकतम फिल्में गिर गईं मैंने निम्नलिखित प्रश्न लिखा है जो मेरा ट्रेनर मुझसे कहता है कि वह गलत है।

      SELECT COUNT (DISTINCT r.movieratingid) एआर रैंक से आरआर रैम से जुड़ें फिल्म एम ON r.movieratingid = m.rating_movieratingid GROUP BY गिनती (अलग-अलग आर.एमोवीरेटिंग) होविंग गिन (एम। मोवीड) = (फिल्म एम 1 से SELECT sum (m1.movieid) जहां m.movieid = m1.movieid)   

    कृपया मुझे बताओ क्या उपरोक्त क्वेरी में गलत है।


    • मूवी सारणी

      मुझे यकीन नहीं है कि मैं आपको पूरी तरह से समझता हूँ .. आप इस कोशिश कर सकते हैं

        SELECT movierating, COUNT (r.movieratingid) AS रैंक से रेटिंग r इनर फिल्म में शामिल हों r.movieratingid = M.rating_movieratingid GROUP द्वारा r.movitting    

    Sanitizing user inputs with Spring MVC frame work -


    I am working on a web application using the work of Spring MVC frames, I want to know that the user input is sanitized Is there any best way to do this or to avoid attacks of XSS and SQL injections to normalize all user inputs in springs?

    You can use the filter in the Spring Framework to clean your form. Code> filters will receive all your request attributes and clean them all before processing the request. Using another option, JSoup API, go to the following link to learn more.

    Edit:

    How To Know OWASP Sheet Read To Avoid XSS And SQL Injection

    Take a look, which is integrated with Spring 3.1, there is out-the-box support for XSS, CSRF, Data Integrity Check.

    php - Notice: Undefined index: id in -


    I have written the code but I am still working:

    Notice: Undefined Index: C: \ xampp \ htdocs \ Portfolio \ periode4 \ graden \ array.php on line 35

    Do anyone know what I have to do to remove the notice?

      & lt ;? Php function connect () {// Create a MySQL connection $ link = mysqli_connect ("local host", "root", "", "school") or die (mysqli_error ()); $ Link returned; } If ($ _GET) {$ id = $ _GET ["id"]; } // Select query $ query = "SELECT * FROM graden"; $ Result = mysqli_query (connect (), $ query); // tableclick macen $ table = "& lt; table range = '1' & gt;"; $ Table = ". & Lt; tr & gt; & lt; th & gt; id & lt; / th & gt; & lt; th & gt; Graden celsius & lt; / th & gt; & lt; th & Gt; Aanduiding & lt; / gt; & lt; th & gt; Image & lt; / th & gt; & lt; / tr & gt; "; // The next line goes as long as there are no more to receive ($ line = mysqli_fetch_assoc ($ result)) {$ table = "& lt; tr". ($ _ Get ['id'] == $ line ['id']? Style = 'background-color: yellow' ":" ")." & Gt; "; // Print the content of each line in a foreign currency ($ line = $> $ value as $ line) {if ($ key ==" image ") {$ table. =" & Lt; Td> & Lt; Img src = '$ Value' / & gt; & Lt; / Td> ";} Elseif ($ key ==" id ") {$ table =" & lt; TD & gt; & Lt; A href = 'array.php id = $ value?' & Gt; $ Value & lt; / A & gt; & Lt; / TD & gt; ";;} and {$ table. =" & Lt; Td> $ Value & lt; / Td> ";}} $ table. =" & Lt; / Tr & gt; ";} $ table. =" & Lt; / Table> "; Echo $ table; // OptiList // Select the MacKey query $ query =" SELECT id, temp FROM graden "; // uitvoeren select the query $ result = mysqli_query (Connect ()) $ Query); // tonel alle gegevens $ selection = "& lt; Form action = \ "array.php \" method = \ "received \" & gt; \ N & LT; Selection name = \ "id \" & gt; \ N & LT; Option value = 'id' & gt; --- All --- & lt; / Options & gt; \ N "; while ($ line = mysqli_fetch_assoc ($ result)) {$ selection =." & Lt; Option value = '"$ line. [' Id '].' '' & Gt;" .. $ line ["temporary"] "& lt; / Options & gt; \ N ";} Select $. =" & Lt; / Select & gt; \ N "; Select $. =" & Lt; Input type = \ "submit \" & gt; \ N "; Select $. =" & Lt; / Form & gt; \ N "; Select $ counter;    

    If any Id parameter, it will definitely fail:

      $ table. = "& Lt; Tr "($ _GET ['id'] == $ line ['id']? Style = 'background-color: yellow'": ""). "& Gt;";   

    Try

      $ table. Style = 'background-color: yellow' ":" = "& lt; tr (Isset ($ _gET ['id']) and $ _GET ['id'] == $ row ['id']? ")" & Gt; ";   

    But he probably will break the argument a bit, you have to check ..

    debugging - Error in MATLAB code -


    Then I wrote the following code and I get an error which says:

      ==> Matrix dimensions should be repeatedly agreed. ==> Error 28 on the edges without title 2 = ifft (fft (song). * Fft (myFilter));   

    This is the code I used:

      [song, fs] = wavread ('c scale fast.wav'); P = 20000/44100 * FS; Filter length% N = length (song); Song Length = 0: 1 / FS: (Length (song) -1) / FS; % And sample frequency song = song / max (stomach (song)); % Gaussian filter x = linspace (-1, 1, n); Include vector vector of between -1 and 1 sigma = 0.335; Gausi formula myphilter = -x *% Standard deviation used in APP (- ^ x ^ 2) / (2 * sigma. ^ 2);% prefixed myFilter = myFilter / sum (myFilter)); % Normalize% fft convolution song = song (:); MyFilter = myFilter (:); Song (length (song) + length (myFilter) -1) = 0; MyFilter (Length (song) + Length (MyFilter-1) = 0; Edges = ifft (fft (song). * Fft (myFilter)); Tedge = Edge (P / 2: N + P / 2-1); P / Shift by% 2 then peaks line up w / edges tedges = tedges / maximum (abs (tedges)); Can anyone tell me what's wrong here? ?   

    Well, your error tells you what line your error is on, then on that line It also tells you which tasks are of error The time is "You" do not know what it is, so you are seeing it in the doctor file, it exits. Operator. Your error tells you that "Matrix dimensions do not agree" - what's this Does matrix, dimension, do not agree - you have two variables different sizes.

      Song (length (song) + length (myFilter) -1) = 0; MyFilter (Length (song) ) + Length (MyFilter-1) = 0; Edges = ifft (fft (song). * Fft (myFilter));   

    These rows are Your error is that you are extending the length of the song and then defining myFilter over the length of the song , then trying again Are there. * It's (converted) code> song . Unless you tell many points to use fft / ifft, you will get the output of the same size of input, so it is not going to work. I imagine that you want them to be both the same length. Then, something like this should be done:

      song (length (song) + length (myFilter) -1) = 0; MyFilter (Length (song)) = 0;   

    I do not think you mean to change the length of the song. I think you need to:

      myFilter (length (song)) = 0; Instead of   

      song (length (song) + length (myFilter) -1) = 0; MyFilter (Length (song) + Length (MyFilter -1) = 0;    

    file get contents - PHP file_get_contents() behaves differently to browser -


    I am trying to download the contents of a web page using PHP. When I issue an order:

      $ f = file_get_contents ("http://mobile.mybustracker.co.uk/mobile.php?searchMode=2");   

    This gives a page that reports that the server is down, even when I paste the same URL into my browser, I get the page I expected.

    Does anyone know what is the reason for this? Does file_get_contents transmit any header that differentiates the browser request?

    Yes, there are differences - the browser sends a lot of additional additions, I will say; And those sent by both, they probably do not respect the same.

    Here, after performing some tests, it seems that the accept is an HTTP header;

    This additional rule can be specified by using the third parameter of file_get_contents :

      $ Opts = array (' Http '= & gt; array (' method '= & gt;' GET ', //' user_agent '=> "Mozilla / 5.0 (X11; U; Linux x86_64; en-US; rv: 1.9.2) Gecko / 20100301 Ubuntu / 9 10 (activator) Firefox / 3.6 ", 'header' => array ('Accept: text / html, app / xhtml + xml, app / xml; q = 0.9, * \ / * ; Q = 0.8 '),)); $ Context = stream_context_create ($ opts); $ F = file_get_contents ("http://mobile.mybustracker.co.uk/mobile.php?searchMode=2", false, $ reference); Echo $ F;   

    With it, I'm able to get the HTML code of the page.


    Note:

    • The first test that passed through I user-agent , but it is not necessary - This is the reason that the related line is in the form of a comment here
    • Before trying for file_get_contents , when Firefox is requested from that page, then < Values ​​are used for the value> accepted header.
      • Some other values ​​may be fine, but I have not been tested to determine which value is necessary.

        • - This is an interesting page, here; -)

    iphone - Losing Contents of NSArray after ViewDidLoad -


    I am working on my first iOS application: a cookbook that stores an array of recipe recipes The array is declared in a header file such as:

      @property (nonatomic, strong) NSArray * recipeArray;   

    Views In theDidoadload method I fill the array like recipes from the XML file:

      Self. RecipeArerere = [[NSARAOL] InitVithArere: SERIFAFormXML];   

    Within the viewDidload method, after that line of code I am able to successfully access the contents of the array.

    The problem occurs when I want to use the array in the prepareForSegue method, the array seems blank. For the beginning of preparing for the right, for the SEGEE method, I put the test in the output statement:

      NSLog (@ "Segue to name name:% @", [myself. ક્રેਪੀરા [0] name]) ;   

    And it is printed with "name called segu": (null)

    Why does this happen? How can I get the contents of the array and how come it can not be saved after executing the visual diode method?

    Many examples of a very common early mistake are an object, usually a view controller. This can happen if you instruct your view controller programmatically but the controller is also specified in the .xib or storyboard file. For example, if you have a Segue between two view controllers in your storyboard, but you are doing something like this:

      MyViewController * vc = [Storyboard Instinct ViewControllerWithIdentifier: @ "MyViewController"] ; Vc.dataFileName = @ "TheDataFile.txt";   

    So many copies of the controller are very likely to be of your problem. You've got one that gives you the intent and the data file as the above, and then creates a storyboard when the user taps a button or otherwise activates the gigu.

    Try entering a breakpoint in your -viewDidLoad method and see if the value of self is (this is the address of the view controller in this case) The times you kill it.

    If your problem is actually, due to the many copies of your visual controller, you might think that if you do not instantiate it, then the view controller should be set. The answer is, of course, this is what is for -prepareForSegue: This is where you can tell the new view controller which files can get their data, or else You can set the visual controller so that it can do its job.

    javascript - function not being called first time script runs -


    I'm new to JavaScript and I have an initial catch on the concepts. I have a function that is one km from the redness It appears on this screen (some clustering part of this function was supplied by a person at S / O), it works perfectly for all the blankets to be loaded except for the first time.

    I'm sure this problem is something with variables and its scope, but for my life, I do not know where or how I am getting the error, I will improve the code in a great way But just useful for the improvement of my understanding (or lack of there).

    Many thanks in the editor

    Here is the code

    Edit 1 ) I have changed the function getlabel several times and the changes have only been shown on the Kembs The first AJAX call shown was loaded out of the call, I understand why this is not happening for the life of this happening. This can be a relevant issue, though it is beyond my understanding of the subject.

       var tripid = 1; Var myStyles; Var ceramidad; Var navigate = true; Var edit = false; Vector vectors; Var polycontroll; Var bound = false; Var McCloster; Var label = ""; $ (Document) .ready (function () {$ .ajax ({type: "POST", url: "temp.php", datatype: "json", error: function (e) {warning ('error:' + E);}, success: function (data) {if (data [0] === "no") {window.location = "http://www.g4ema.com/index.html";} maxlat = data [0]; Makslon = data [1]; Minlat = data [2]; Minlon = data [3]; Tripid = Parsaint (data [4]); var Boksks = new Open Leyrs. bounce (); Bibiaks.andend ( new) OpenLayers.LonLat (minlon, minlat)); bbox.extend (new OpenLayers.LonLat (maxlat, maxlon)); bbox.toBBOX (); map = new OpenLayers.Map ( "map"); // var layer = New OpenLayers .Layer.OSM (); mycluste R = New OpenLayers.Strategy.Cluster ({limit: 2, // single groups are shown as mustCluster features: function (cluster, feature) {if (feature.geometry.CLASS_NAME === "OpenLayers .Geometry.Point "& amp; & amp; cluster.cluster [0] .geometry.CLASS_NAME ===" OpenLayers.Geometry.Point ") {return OpenLayers.Strategy.Cluster.prototype.shouldCluster.apply (this, arguments);} Else { Return false;}}}) var layer = new open layer Layer.Google ("Go Hybrid", {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}); Layer.wrapDateLine = false; Map.addLayer (layer); myStyles = new OpenLayers.StyleMap ({ "default": New OpenLayers.Style ({strokeColor: "# 00ffff", strokeWidth: 5, strokeOpacity: 1, fillColor: "# 003,399", fillOpacity: 1, labelYOffset: 15, pointRadius: 4, label: "$ {getLabel}", fontColor: "# ff0000"}, {reference: {getLabel: function (f) {label = ""; if (f.cluster) {// is a cluster, if ( F.cluster [0] .attributes.label! == "") {label = "" + f.attributes.count + "" + f.cluster [0] .attributes.label;} and {label = ""; / / + F.attributes.count + "init";}} else {// is not cluster if (f.attributes.label! == "") {label = "" + f.attributes.label;} else { Label = "";}} If (label!) {Label = "";} return label;}}}}}); kmlLayer = new OpenLayers.Layer.Vector ( "Trip", {styleMap: myStyles, projection: map.displayProjection, strategies: [New OpenLayers.Strategy.Fixed (), mycluster], Protocol: New OpenLayers.Protocol.HTTP ({parameters : {tripid: tripid}, url: "kml2.php", readWithPOST: true, // {user id: user ID, tripid: tripid}, format: new OpenLayers.Format.KML ({extractStyles: true, extractAttributes : truth}) })}); Map.addLayer (kmlLayer); Var clat = (paraslot (minalat) + purphhot (max list)) / 2; Var clone = (paraslot (minnl) + parsflot (maxlon)) / 2; Var Lonat = New OpenLayer Lonatat (Clone, Claat). Transformform (new open layer projection ("EPSG: 4326"), new open layer projection ("EPSG: 900913")); Map.setCenter (lonlat); Map.zoomTo (15);  

    First of all, I do not get the benefit of declaring label variables shared by you Global Realm in the context of the code made since you are returning a label from the getLabel function, so I think you only have to declare the var label , at the top of the getLabel function and with that function that local variables Return the value of

    Second, the only way I can find that "undefined" will be returned with GetLabel if f.attributes.label is undefined. I'll try a code block such as:

     } else {// is not cluster if (f.attributes.label! = Null & amp; amp; amp; amp ; Amp; amp; amp; amp; and; "undefined") {// if (f.attributes.label) {// Optional if simple; statement label = "" + f.attributes.label;} else {label = ""; }}    

    How to parse MS Word document by style with VBA -


    I go through an MSWord document and try to draw all paragraphs with style, "question" and then Repeat them at the end of the document. Any suggestion would be super helpful - what I have here (I think all the steps are here because I'm having trouble with VBA formatting).
    The sub-bridge question () is a new line at the end of the '' pull quest macro '' document curpled on every curPar in ActiveDocument. .ListParagraphs.Count 'publication', then curPar.Selection.Style = "question", then Selection.TypeText (curPar & VbCr) if the end subs >>

    I think you might find the search function for you to find the more efficient following code document and the values ​​in an array Put not and then put them in the end of the document. This paragraph style will also be set to reflect the original. Keep in mind that if you continue with the styles applied to the output at the end of the document, you will get a bad output.

    I have commented it quite well but let me know what to understand 'to understand it.

      sub searchstyles () dim as iCount integer, iArrayCount as integer, bFound as a boolean 'We will store our result in an array so that it set (consider 50 entries) ) Redeem = wdStory 'set your search parameters and look for the first example with: sArray (1 to iArrayCount) string as iArrayCount = 50' state your style type sMyStyle = "Title 1" 'Always Document Selection.HomeKey Selection.Find starting at the top of the unit .ClearFormatting .text = "". Replacement.T Ext = "" .ward = true .rap = wdFindContinue .format = false .MatchCase = false .MatchWholeWord = false .MatchKashida = false .MatchDiacritics = false .MatchAlefHamza = false. MatchControl = False .MatchByte = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchFuzzy = False .MatchWildcards = True .Style = sMySt Yale. 'If we meet one we can set a loop to check' I have always kept a look for a reason to avoid the interval loop or do not do during any other choice. Find.Found = True and iCount & lt; 1000 iCount = iCount + 1 'If we have any results, then add the text to the array if selection is selected. Find.Found then bFound = True 'we do a check on the array and resize the size if necessary (more efficient than resizing every loop ii mod iArrayCount = 0 then save ReDim sArray sArray (iCount) = Selection .text 'Find Selection.Find.Execute End Reset LOOP if the' real size 'array to save the final form reDim sArray (1 UBound (sArray) + to iArrayCount) (1 to iCount) if the bFound' document again ActiveDocument.Bookmarks ("\ EndOfDoc"). For Range.Select Selection.TypeParagraph ii = LBound (sArray) for UBound (sArray) Selection.Text = s Output to Array (ii) Selection.Range.Style = sMyStyle Selection.MoveRight wdCharacter, 1 then ii & lt; UBound (sArray) then Selection.TypeParagraph Next ii end then End Sub    

    variables - Passing two values from awk to bash -


    I have a list of prices in which I am the most and awk bash I am able to find these, but I am unable to assign values ​​to some variables, so I can use them later in bash .

    My input:

      Number position length value 1 2 40 0.96 --- 5 45 0.97 4 5 47 0.96 --- 5 35 0.95 2 5 60 0.95 -     Minimum = $ 3} {if ($ 3> max) max = $ 3; If ($ 3 & lt; min) min = $ 3;} END {print max, minimum} 'List.txt   

    Output: 60 and 35 .

    I know that it is possible to send values ​​from bash to awk -v with my < Code> awk script

      variable1 = string; Awk -v variable1 = $ variable '{}'   

    Is there a way to do the same thing, but to bash from awk, so i min And max ?

    You can do this:

      read-r max minutes & Lt; & Lt; ($ 3 & lt; minutes) min = $ 3;} END {print max, minimum}  max) max = $ 3;   

    then:

      echo $ max echo $ min   

    OR:

      arr = ($ (awk 'NR == 1 {max = $ 3; Min = $ 3} {If ($ 3> max) max = $ 3; if ($ 3 & lt; min) min = $ 3;} END {print max, min} 'List.txt))   

    then:

      resonant $ {arr [0]} # maximum resonance $ {arr [1]} # min   

    OR:

      set - $ (awk 'NR == 1 {max = $ 3; minutes = $ 3} {if ($ 3> maximum) max = $ 3; if ( $ 3 & lt; minutes) minutes = $ 3;} END {print max, minimum} 'List.txt)   

    then:

      max = $ 1 min = $ 2    

    local - Installing Magento locally with MAMP -


    I am trying to install the latest version of the Magato community locally on a Mac, but it does not work . / P>

    • I have downloaded the latest zip version
    • I have created a database in phpMyAdmin and imported sample data
    • I removed the zip files and pasted I

      was the requested URL / Magenta / when I navigate to 127.0.0.1/magento/, then in the MAMP / HTDOX / Magenta directory

    • this server Not found on Apache / 2.2.22 (Unix) DAV / 2 Server 127.0.0.1 Port 80

      I have a MMP Pro Krn is not because it is the only thing that I can think of. I have seen different (old) posts with people with similar errors, no one who has not fixed my problem.

      Any thoughts?

      port 80 no That is, when you run the MAMP app, you can do it - I'm not sure you are doing this! (Although you say that you use phpmyadmin, you may be).

      (Run / app / map app and you get some control windows which lets you start the stop server etc.)

      Then run the MMP and check 127.0.0.1:8888/ Maggato

    javascript - Asual $.address - how to get rid of hashtag -


    I'm using asuals jquery plugin $ .address

    Everything is working but The URL still offers the hash tag (

      $ ("# ulSideNav a"). Address (function () {return $ (this) .attr ('href'). Replace ("   

    (return "/ suburban")

    $ address.change (function (event) {var uri = Event.value; if (Yuri Length> 1) {ajaxRequest (uri);}});

    URL (no base URL)

      Changes to $ ('# ulSideNav a') makes an Ajax request. Click (function (e) {$ (" AddClass ('Active Selected');});   

    Activate Navbar The status is turned on

      http: // BASEURL / # / suburl   

    this is how the URL looks at the end

    So my question is => how to delete that hashtag

    (Maybe some location with window, but all my efforts fail)

    Try it out,

      newurl = window.location.href.replace ("# /", '') console.log ( Newurl); Window.location.href = NEWURL;