Posts

Showing posts from April, 2010

playframework 2.2 - How to resend verification email in play authenticate? -

I'm stupid to ask, but I do not know how to send a verification email to the user who 'emails and Login using amp; Passwords on play certification, i.e. A user has signed up for an account, the token has expired at the verification email, and a new verification email is required. I understand that the original verification email is created after the user account and is logged in later, but I can not understand how to do a user with logging in. I believe you have wrong order order, emails are sent after email is created and First they log in. If they are already logged in, they will have to verify the email. If they never accept the email, then I believe that you will have to ask the user to sign up again and a new email will be sent. .. Chet

c# - Why does this thread cause my application to hang up after multiple executions? -

I created this test program to try to understand a little better threading: Nom place thread test {public class 1 class} {static number number = new number (); Get Stable Public Zero () {Thread T1 = New Thread (New Thread Start (Increase Number)); t1.Start (); IncrementNumber (); } Public stable zero incrementNumber () {number.Inc (); }} Public class number {int x = 0; Public Zero Inc () {x ++; Debug.Write (x); Debug.Write (Environment.NewLine); } Public override string toasting () {return x.ToString (); }}} I call it Thread Test Class 1 Go and execute from the immediate window. I saw that from one execution until the next, unless it needs to be compiled again, static members live in memory and it is using them again. Here's what the immediate window looks like after the four continuous execution: Thread Tests. Class 1 Go () 2 1 expression has been evaluated and it has no value Thread Test. Clash 1. Go (3) 4 evaluation has been evaluated and it has no value Thread Te...

how to pass input during executin of java code in eclipse -

I want to retrieve my Java code in Eclipse (and main method using ARG [] command line I argue) -It's okay. However, my scenario is different. My code asks periodically for input during execution. Where do I enter such inputs? When some of the controls come down to the command line arguments or suggest using a buffer reader or console view, I edit : But my Eclipse collects the correct message after asking for a pseudo password (forward, my position is different from the command line argument as explained in the first line). I am using centr 6.5 on Kepler A near eclipse The console is usually located below your Java perspective. If it is not just window-> View- & gt; Show console

loop in r until value converges and stores all the outputs -

Image
I would like to repeat this process until there is no condition to censor results. Here is a simple matter, where I know the number of cycles in order to perform a loop: # Example of figures Speplus & lt; - rnorm (100,50,50) encyclopedia and lt; - 1000 outcomes & lt; - Matrix (Enro = Encyclix, Nackel = 1) Repeat the process of # N chakras for (i (sample (SMPLS, 50) ) 1 / NCK () (Output) (SMPLS, 50)) P> But my case is different in that sense I do not know the nosy. I want to continue sampling until the samples get very little variance or convergence (I think this is "while" loop. For example, unless vsd is less than 1 in the following case. vsd & lt; - (SMD, 50)) while (vs> 1) {outm [i] & lt; - Mean (sample (SMPLS, 50)) vsd & lt; - SD Edit: - rnorm (100,50,50) ITER & lt; - 0 # Maximum Travel Itermax & LT; - 1000 outm & lt; - Representative (NA, itermax) vsd & lt; - 2, while ((vsd> 1) & amp; (ITER's ...

php - Magento CE Customer Groups Changing Not Saving -

In the Magento CE Admin panel, I type customer & gt; Manage Customers Then tick the selection box in the Customer Line that I want to allocate to a group, then I select 'Assign to a client group' in the 'Action' dropdown above. Select the group and then click on 'Submit'. Then I had a 'Total Records (Updates)' message displayed above, but the problem is that my client group has not been updated / saved! No errors, but not updated! I also tried to edit the customer group by editing the client's account information 'group' settings, but the result ?! I do not know how to solve it thanks > Here the client's group is automatically updating due to the VAT ID. Please select / edit the check box on "Disable disabled group changes based on customer ID" under "Groups", select the drop-down on the customer's details page, click the "Account Information" tab. Please share and comment if h...

Cordova support for Amazon FireTV ("android_interface.jar" error) -

I used the original "Hello" for the Amazon Fire tablet and using Cordova (3.4.x) to create a custom HTML app. Have done I was connected to a problem and resolved it according to the answer (chmod + x on the construction tool). However, when I try to deploy the same app ("Hello" and the HTML5 app) Amazon Fire TV device, I see this error: Application error AndroidWebKit classes are missing Copy the Android-Interface.jar in the App's Libs folder from Amazon WebVS SDK and recreate the app. There is no file named "android_interface.jar" in the Amazon WebVV SDK. I tried copying "awv_interface.jar" to the app's Libs directory; no change. I also tried to rename the awv_interface.jar name for Android; Failed to compile the app. The normal Android target of Cordova will actually run on Fire TV; The "Hello" app works, but the five-way remote is not registered on our HTML5 app, so I'm really using the Amazon-Fireros targ...

javascript - draw a polygon with fabric.js framework -

I am trying to attract a polygon by using this code: Canvas.on ('mouse: move', function (option) {if (lines [0]! == empty & amp; objects. Type == "roof") {set startpoint (option); lines [ Line-clock-1] .set ({X2: x, y2: y}); canvas.reader ();}}); This works perfectly in jsfiddle but using the same code on my page, the lines are not drawn to the polygon where I can "paint really" the top left "Birth" in the corner, but when I click to create a polygon it pulls it correctly. Can anyone help me? The problem is with the mouse down event, you are setting the organics and the origin in the right corner of the corner. Takes it. I have given below the updated code. Function Massoudown (event) {setStartingPoint (event); Var number = [x, y, x, y]; Var line = new clothes. Line (number, {left: x, top: y, strokeview: 1, selectable: false, stroke: '# 40648E'}); Lines.push (line); Canvas.add (lines [lineCounter]); Var rect = new fa...

javascript - Live JS/Jquery, Html, CSS Editor -

I am making my own code for a live HTML / js / jquery / css editor. It's just the code to inject CSS, HTML and Javascript (especially junkies). CSS and HTML are working fine, but whatever I'm not doing, jquery or javascript for iq start working ... myres heres: var content = $ ('iframe ') .contents (), body = contents.find (' body '), style tag = $ ('

php - preg_replace_callback returning same as input -

$ post = preg_replace_callback ("/ \ [स्मार्टक्वाइट] ((?: (?! \ [Smartquote \] )।) ++) \ [\ / smartquote \] / s ", फ़ंक्शन ($ मैच) उपयोग ($ pdo) {if (isset ($ match [0])) {$ returnData = explode ('_', $ मैच [1]); यदि (रिक्त ($ वापसी डेटा [0]) || रिक्त ($ वापसी डेटा [1]) {वापसी 'कुछ भी नहीं मिला';} और {$ getPost = $ pdo- & gt; तैयार ("SELECT * `पोस्ट` से WHERE` tid` =: topic_id और amp; `id` =: id"); $ getPost- & gt; बाइंड वैल्यू (': topic_id', $ returnData [0]); $ getPost-> gt; bindValue ': Id', $ returnData [1]); $ getPost- & gt; निष्पादित करें (); यदि ($ getPost-> rowCount () == 0) {वापसी '& lt; div class = "well" & gt; & lt; H5 & gt; उद्धरण: & lt; / h5 & gt; & gt; div शैली = "फ़ॉन्ट-आकार: 12px;" & gt; उद्धरण डेटा & lt; / div & gt; & lt; / div & gt; ';} और' वापसी 'कुछ, कुछ, गहराई।'; }}}}, $ पोस्ट); मैं इस पर हर बार प्रतिक...

ruby - Rails 4 - cannot load such file -- rich (LoadError) - After removing gem from gemfile -

I have removed a gem from my gemfile (especially this). I have run the bundle update . I can not start server or migrate DB due to this error, because now I am getting: / lib / active_support / dependencies Rblege29: in 'required': can not load such a file - rich (load erroire) I have trouble in removing this gem too. To find all references to gem and to remove them, simply run a search in your application. Unfortunately I could not find any other way than manual removal.

c# - Errors with installing Prism in visual studio -

I am trying to use Microsoft. Practice. Prism Library in Universal Windows Phone / Windows 8.1 app in Visual Studio 2013. It was working very well for the first day. Today when I log in, my build will fail because he claimed that it was no reference to Microsoft. Practice, however Intelligence will take both Microsoft. Practice and Microsoft. Practice. Prism So I uninstalled the prism via the new package manager, then restored it. Now I am getting this error. I have claimed that the post has updated the Newsgate to resolve this issue but I have the most recent version (I am uninstalling and reinstalling NUG) "Https://i.stack.imgur.com/dB20D.png" alt = "This is the error I got"> Edit: Just to clarify Support for 4.5 is therefore not really able to make this error a lot. Will not install a NuGet package Rojekt which is targeting the .NET framework. Which is not included in the NuGet package. Your project is targeting the Windows 8 / Windows Store ...

Javascript regex match doesn't run correctly -

ठीक है, मैं हारता हूं यहां मेरा कोड है: var re = /href="(http.*\.jpg)"/g; var mp3s = body.match (पुनः); यह चित्र पाता है, लेकिन यह लौटने के बजाय href = "http://www.picture.com/smthg.jpg" देता है किसी भी विचार क्यों? से परिणाम () वास्तव में है एक ऑब्जेक्ट। मुझे लगता है कि आपको उस ऑब्जेक्ट पर पहला एलीमेंट एक्सेस करने की आवश्यकता है। उदाहरण के लिए: body.match (पुन) [ 1] यह वह जगह है जहां वास्तविक परिणाम रखा जाता है। बेशर्म आत्म-प्रचार: मैंने अपने लिए एक छोटी सी किताब लिखी है, मुझे कभी नहीं याद होगा इन दोनों का उपयोग करें यह यहां है:

uibutton - Hiding button leaves whitespace instead of dropping down top button in ios -

Image
I am hiding another button below, but I want to drop down the top button. Is there a way to do this where it has a relative layout? You can do this. I had to do one of my projects if you are using autolayt then you can not manually change your button frame. You can either disable AutoLout, or modify the program restrictively. I follow the first one. If you want the first button to take the position of the second button (which you are hiding) then take the frame of the second button and assign it to the first button. Hope it helps. :)

c - Program hangs after using pipe, fork and exec -

I use pipe fork and exec to implement a normal pipe for any two shell programs. I'm specifically using ls. Grep does this to test it, the data is copied to copy, search grep for the match, and then outputs them on stdout. However, after that the program is still hanging. This is my code when the pipe is detected. I have fork, and then fork again because I want to continue to run the original process of the fork after the execution call. Because of the debug code I believe that grep is executed after calling exec (), nothing is happening if (pipeflag == 1) {pipe (FD); Pid = fork (); If (PID == 0) {// hair process fPID = fork (); If (FPID == 0) {// baby child of printf ("child's baby \ n"); Dup2 (FD [1], 1); Execvp (command, argv); // Printing error is required ("mysh:% s: command not found \ n", argv [0]); Exhaust (EXIT_FAILURE); } If (FPID & gt; 0) {Parents of the second child's child ("in the second child's pare...

c++ - Spirit semantic actions after eliminating Left Recursion -

To eliminate the left recursive after following the sample in the Spirit Classic FAQ, I understand the correct placeholder for Phoenix I am unable to interpret the meaning of my non-work grammar as shown below: template & lt; Typename this, typename Skipper = qi :: space_type & gt; Structure Parser: qi :: grammar & lt; This, xp (), ska & gt; {Parser (): Parser :: Base_type (expression) {Namespace QI; Expression = word [_val = _1]> & gt; * ((Four _ ('+') >> [_val = phx :: construct & lt; binop & lt; op_add & gt; & gt; (_ 1, _2)] | (four _ ('-')> gt; & gt; _val = phx :: creation & lt; binop & lt; op_sub & gt; (_ 1, _2)]); word = factor [_val = _1]> gt; ; & gt; * ((four _ ('*')>> Factor) [_val = phx :: construct & lt; binop & lt; op_mul & gt; & gt; (_ 1, _2)] | (_ _ _ _ _ = Phx :: creation & lt; binop & lt; op_div & gt; & gt; (_ 1, _2)]); factor = uin...

how to find the total time taken by a job in oozie -

Is an OOG commendline that I can use or submit to determine the beginning and end time of a Ozzy jobs Have done through a coordinator? Yes, you can see the start and end time of a coordinator job $ oozie job-hoozee http: // localhost: 8080 / oozie -info 14-20090525161321-oozie-joe For more information,

clojure - how to get a list of constant mappings in the java class constant pool? -

जब मैं javap -c address.class & gt; मुझे एक विशिष्ट वर्ग पर txt मुझे निरंतर पूल सूचकांक के रूप में # & lt; NUMBER & gt; "address.java" से सार्वजनिक वर्ग की परीक्षा में संकलित किया गया है। पते से परीक्षा का विस्तार होता है। एन्टीटी {सार्वजनिक परीक्षा। पता (); कोड: 0: अलोडिड 1: अभिनव # 1 // मेथड टेस्ट / डिफॉल्ट एन्टीटीआई। "& Lt; init & gt;" :() वी 4: अलाउद्दी 5: एसीनस्ट_एनल 6: पॉल्डफ़ील्ड # 2 // फ़ील्ड आईओ: लाजावा / लैंग / स्ट्रिंग; 9: अलोडिसी 10: एसीनस्ट_एनल 11: पल्डफील्ड # 3 // फ़ील्ड ज़िप 4: लाजावा / लाँग / स्ट्रिंग; 14: अलाउड 15: एसीनस्ट_एनल 16: पल्डफील्ड # 4 // फ़ील्ड ज़िप: लाजावा / लैंग / स्ट्रिंग; 1 9: अलोडिड मैं एक हैशप के रूप में पूल कैसे प्राप्त कर सकता हूं? अर्थात्: {1} विधि परीक्षण / डिफ़ॉल्ट ऊंचाई। & Lt; init & gt; ":()" 2 "फ़ील्ड Io: Ljava / lang / string;"} के साथ, आप एक .class फ़ाइल को पढ़ने के लिए उपयोग कर सकते हैं और फिर getItemCount () और विभिन्न पढ़ने के तरीकों का उपयोग कर स...

jQuery: Div not showing (easeOutBounce) -

मेरे पास यह स्क्रिप्ट है: $ ('select')। परिवर्तन (फ़ंक्शन ( ) {$ ('# शोमे')। चेतन ({शीर्ष: '- = 100 पीएक्स'}, 500, 'आराम ऑटबॉइस');}); ये अभी काम नहीं कर रहा है मेरे पास jquery और jquery.easing.min.js लिंक है। मैंने भी jQuery UI लाइब्रेरी को जोड़ने का प्रयास किया, लेकिन उसने कुछ भी नहीं किया। मुझे क्या याद आ रहा है? यह मेरा जेएसफ़िल्ड है: उस तत्व से डिस्प्ले: कोई भी निकालने का प्रयास करें जिसे आप एनिमेट करने का प्रयास कर रहे हैं। यह मेरे लिए काम किया। ।

c# - Checking if a MainWindow already exists -

I have a C # / WPF application that has a main window and system tray icon when I close the main window To keep an application running in the system tray, configure App.xaml with ShutdownMode = "OnExplicitShutdown". In the context menu of the system tray icon, I have the menu items binding for ways to reopen the main window: Private Zero SysTray_Information_Click (Object Sender, RoutedEventArgs E) {var newWindow = new MainWindow (); NewWindow.Show (); MainWindow.Focus (); } I would like to add these methods to see if the main window is already being displayed (not closed). Otherwise it would be possible to open many copies of the main window. How can I get this? At the application level a semaphore or mute x would be appropriate This code is for a winfroms app, but me Be sure that it can be modified to suit your needs. Fixed Zero Main () {System.Threading.Mutex appMutex = New System. threading. Mute x (true, "MyApplicationName", Exclusive outside);...

mysql - JPA Hibernate Nested Objects -

असल में मेरे पास 3 टेबल हैं: देश, राज्य और CITY में देश.जावा: @OneToMany (कैसैडकेड = कैस्केड टाइप। आह, fetch = FetchType.EAGER) @JoinColumn (नाम = " COUNTRY_ID ") निजी सूची & lt; राज्य & gt; राज्य = नया वेक्टर & lt; राज्य & gt; (); state.java @OneToMany (cascade = CascadeType.ALL, fetch = FetchType.EAGER) में @JoinColumn ( Name = "STATE_ID") निजी सूची & lt; शहर & gt; शहर = नया वेक्टर & lt; शहर & gt; (); जेपीए क्वेरी की तरह दिखता है: caEntityManager.createQuery ("सेलेक्ट सी से देश सी। सीस्टेट एस जॉइंट फ़ेच एस.सी.टी.टी. getResultList (); जब मैं क्वेरी को निष्पादित करने की कोशिश करता हूं: org.hibernate.loader.MultipleBagFetchException: एक साथ कई बैग लाने नहीं कर सकता मुझे यकीन है कि मेरी क्वेरी गलत है, मैं इसके लिए नया हूँ, कृपया मुझे सही दिशा में नियुक्त करें I धन्यवाद समस्या हाइबरनेट दो बैग नहीं ला सकता है उत्सुक ly। त्वरित समाधान सूची से सेट s को पढ़ने के लिए होगा: इसके अला...

c++ - least frequent common number from a int array -

I want to get the least common number from an integer array, I have written the code but it is not working properly Here's my argument, 1. Sort the array 2. Update the Mid Common Counter 3. If all are unique and the code below, static integer min_loc; // minimum price position constant end min_cnt; Int all_uniqFlag = true; Zero atleast (int data [], int n) {int rcount = 0; // repeat count counter int mcount = n; // minimum redirect counter; // array is already sorted, we just need at least the normal value. For (int i = 0; i i-++) {// Case A: 1 1 2 2 2 3 3 3 3 4 5 5 5: The result should be 4 / Case B: 1 2 3 4 5 6 7 (All the unique numbers and common values ​​should therefore be printed on all values ​​// //) C: 1 1 2 2 3 3 4 4 (All numbers have the same frequency, so display them all Required) cout & lt; & Lt; "Data [i]:" & lt; & Lt; Data [i] & lt; & Lt; "Data [i + 1]:" & lt; & Lt; Data [i + 1] & lt; & Lt; "...

android - Trying to create a compressed bitmap in png format getting 2 errors -

I am trying to create a compressed bitmap. I try to use it to save a second bitmap in the output stream, bitmap compresses the ram, then use the decoded stream to make the bitmap object from the output stream The following errors in my code are: 1. The output to the outputstream is not defined by the metallic to battery. Can not keep the type of outstream in mind. My code inputStream = assetManager.open (sb.toString ()); Bitmap b = bitmapfinder Singlestream (inputstream); / / An OutputStream Output From This Line = Stream Out = New OutputStream () is not copied, error arises; b.compress (bitmap.compress format.png, 100, out); // this; ine is error saying method bitmap decode does not exist = bitmapfichter Decodestream (new ByteArrayInputStream (out.toByteArray ())); Try changing your output speed : BitReon OutputStream Out = New Bytereanputstream (); There is toByteArray () not in the output stream . In the shortcut of inputstream, byteoutputstream will...

IntelliJ IDEA Mercurial Push Hangs -

I have a local Intel IDEA project that is configured to use Mercurial Version Control on BitBeckTet.org. . I can do the file locally (Ctrl + K) and register my changes, but when I try to do a push (Ctrl + Shift + K), it never completes. I have successfully "been pushing" with IDEA v13.1.2 (135.690) before this bittock repository, but I brought v13.1 (135.667) back to the build and only one thing Have to face. Last time I got a successful push 2014-03-21. The background work pane shows the status of a "pushing ..." Occasionally, the status of "incoming incoming and outgoing change ..." is being investigated. My version control console looks like this ... hg.exe branches hg.exe incoming - timetable {rev} {node} {author} {desc | firstline} --quiet --newest-first hg.exe outgoing - template {rev} {node} {author} {desc | Firstline} --quiet --newest-first hg.exe push https: //myUserName@bitbucket.org/myUserName/myProjectName hg.exe incoming - timetab...

parallel processing - RxJava vs Java 8 Parallelism Stream -

What is the difference between all the similarities and what it seems, that some elements in the Java parallel stream are available in Rxjava, that's right. ? RX is an API viewable sequence stream API running The Rx view is push-based for processing the appropriate sequences; You are notified when an element is available; A stream is pull-based ; It may "look" for items for the process, they look similar because they both support the same operator / conversion, but the mechanisms are essentially contrary to each other.

node.js - Cannot npm install for angular-phonecat tutorial : Cannot find module 'update-notifier' -

I'm having issues running an npm in the angular-phonecat directory, I'm thinking it's going to be one with my paths The issue may be, but not sure. Any insight would be much appreciated. I'm getting the error: module 'update-pointer' can not be found if I install it individually, I will get another missing module. $ node / usr / local / bin / node $ npm / users / ashton /. Anode / bin / nm Install $ npm Export PATH = "/ usr / local / bin / node: $ PATH" Export & gt; Angular-phonecat@0.0.0 postinstall / User / Ashton / Dropbox / Learning Projects / Console-Phonecat & gt; Bower installed module Js: throw 340; ^ Error: Module 'update-pointer' can not be found on the function. Function on module._ solutionFilename (module.js: 338: 15). Modulk_lod (module. Js: 280: 25) Modulkrekwayr (Modulekjs: 364: 17) needed (modules. JS: 380: 17) on the object. On ObjectkModulek_extensionskkjs (module) Modulk_kanpail (Modulkjes: 456: 26) to ...

What function implements density / quantile functions for the Raised cosine distribution in R? -

Image
I'm looking for the equivalent of qnorm and dnorm In R drcosd One The creation of prcosd will be considered quite straightforward.

lua table - time complexity of metatable in Lua when accessing -

स्थानीय cls = {base = "base"} स्थानीय इन = {} cls .__ index = cls setmetatable (ins , सीएलएस) ins.base तक पहुंच की जटिलता क्या है? आप आधिकारिक लुआ कार्यान्वयन से O (1) समय की जटिलता की अपेक्षा कर सकते हैं। __ अनुक्रमणिका मैनुअल से ली गई इस लिआ कोड के बराबर है: फ़ंक्शन gettable_event (तालिका, कुंजी) स्थानीय प्रकार यदि तालिका (तालिका) == "तालिका" तो स्थानीय v = rawget (तालिका , कुंजी) यदि v ~ = शून्य तो वापस v अंत एच = मेटाटेबल (तालिका) .__ सूचकांक यदि h == शून्य तब वापस शून्य शून्य और दूसरा h = मेटाटेबल (तालिका) .__ अनुक्रमणिका यदि h == शून्य तब त्रुटि (एक · · · एक प्रकार के अंत (एच) == "फ़ंक्शन" फिर वापसी (एच (तालिका, कुंजी)) - अंत में हेन्डलर को वापस कॉल करें [कुंजी] - या अंत अंत पर पुनरावृत्ति ऑपरेशन __ सूचकांक लुकअप में कोई छोर नहीं है, और चूंकि लुआ तालिकाओं का समर्थन किया जाता है हैश तालिकाओं, तालिका lookups आमतौर पर एक निरंतर-समय का संचालन होता है।

read eval print loop - In Scala's repl, programmatically find implicitly added functions -

I think I use scala repl more and when I do not network, I use it a lot I am adding my work to simplify the search of APIS (the port on the Python Dair) what I am trying to do now has been added by all functions fixing. I could not find any way to get it with Scala reflection, so I thought I wanted to see the compiler how: Built in:. Within repl, is there any way to gain access to the IMAIN instance? If not, there is another (or all underlying conversion method) way to get a list of the methods contained in it? I'm getting these details only within repl, so if it wont care about the work out of repl, that's fine. postprop = "itemprop =" text "> Fwiw, I'm making a couple of improvements to complete the tab, and a suggestion feature is something The tab is to show the enhancements. scala & gt; $ INTP res0: scala.tools.nsc.interpreter.IMain = scala.tools.nsc.interpreter.ILoop$ILoopInterpreter@27fa135a Scala & gt; : Power ** Power User...

Moving drawing in canvas android -

I am trying to transfer the drawing to the canvas. I have a working code but the problem is that when I click on the canvas to pull the second time, it resets it to its initial position (its default position) and then starts again. I left it on my first pull, from where I want to move forward. In the code of my custom view, I have a function called setupCoordinates, where the coordinates of my pictures begin. (X and y, I am using it to move the image. These values ​​are updated by the touch listener of my activity) I am adding my thoughts as a relative layout relLay.addView (custView); There is a touch listener in my layout relLay.setOntouchListener (touch); And in my touch listener I get evet.getX () and event.getY () custView.setXY (evet. GetX), event. GetY ()); Below is the code of my custom view where I am drawing: Public made views (reference context) {super (reference); SetupDrawing (); SetupCoordinates (); } Private zero setup drying () {path = new p...

c++ - move obstacles randomly in game scene in cocos2d-x -

I am creating a game in Xcode using the cocos2d-x (c ++) game engine, and I Starting a game in the game I tried to move obstacles randomly in this game, but it is progressing in sequential order, please solve me the following code I used to move the barrier obs1 = CCSprite :: create ("branch.png"); Int val = arc4random% 7; obs1-> setPosition (ccp (winwsize / val, winhsize / 8)); This- & gt; Add Chald (Obs 1, -1); obs1-> SetVisible (true); Schedule (schedule_selector (SceneThree :: OnUpdateFrame)); Zero GameScene :: OnUpdateFrame3 (Boat deltaTime3) {if (obs1-> getPosition () x & lt; -. (Winwsize / 2)). {obs1-> SetPosition (ccp (obs1-> getPosition () x + (2 * winwsize), obs1-> getPosition () y)). } Obs1-> SetPosition (ccp (obs1-> getPosition () x17, obs1-> getposition () wi).); } First of all, you are only using a random value for the initial position Are there. And on every tick (this is an update function), you just want to reduc...

Algorithm for choosing foods based on macro nutrients -

I have a large group of food ingredients, each of which has protein, carb and fat properties. Example: Food Name PCF Food 1 10 5 3 Food 2 3 10 8 Food 3 4 20 5 I have to type a function that looks like this: Private listing & lt; Food & gt; CombineFoodsBasedOnMacro (P, C, F) This function should choose two different foods and add them to different amounts so that when we select P, C and F Add the quantity of foods they are close to passed P, C, F parameters. Example CombineFoodsBasedOnMacro (45, 40, 20) Acceptable 'answer' can be: P = 44, C = 40, F = 17 My question is, what algorithm can I use for such calculation / approximation? This problem is NP-hard , and for multilevel instead of set There is generalization, and thus there is no known polynomial solution to the problem (and most believe that such a solution is not present). You can use this problem to try and solve, such as: at least sum (x_s) (number of sets), St: S. Um (x_...

php - required "=" in same position in each line in string with str_pad -

मेरे पास follwing स्ट्रिंग है $ string = '$ PropMap ["admin_id"] = सरणी ("फ़ील्ड", "admin_id", "admin_id", "int"); $ PropMap ["सुपरएडमिन"] = सरणी ("फील्ड", "सुपरएडमिन", "सुपरएडमिन", "इंट"); $ PropMap ["उपयोगकर्ता नाम"] = सरणी ("फ़ील्ड", "उपयोगकर्ता नाम", "उपयोगकर्ता नाम", "स्ट्रिंग"); $ PropMap ["password"] = सरणी ("फ़ील्ड", "पासवर्ड", "पासवर्ड", "स्ट्रिंग"); $ PropMap ["mail_id"] = सरणी ("फ़ील्ड", "मेल_id", "मेल_आईडी", "स्ट्रिंग"); $ PropMap ["master_password"] = सरणी ("फील्ड", "मास्टर_पासवर्ड", "मास्टर_पासवर्ड", "स्ट्रिंग"); $ PropMap ["group_id"] = सरणी ("फ़ील्ड", "समूह_आईडी", "समूह_आईडी", "इंट"); $ PropMap ["total"] =...

php - how to fill options in html select based on an html field filled by user. -

यहां कोड स्निपेट है: & lt; चुनें नाम = "isbn" onchange = "" & gt; & Lt;? Php // ड्रॉप डाउन में सभी आईएसबीएन प्रदर्शित करें $ result = mysqli_query ($ con, "SELECT * FROM book"); जबकि ($ पंक्ति = mysqli_fetch_array ($ परिणाम)) {? & Gt; & LT; विकल्प & gt; & Lt;? Php echo $ row ['आईएसबीएन']; ? & Gt; & lt; / विकल्प & gt; & Lt;? Php}? & Gt; & Lt; / चयन & gt; & Lt; / लेबल & gt; & lt; / टीडी & gt; & Lt; / टीआर & gt; & LT; टीआर & gt; & Lt; td & gt; कॉपी नंबर & lt; / td & gt; & Lt; td & gt; & lt; चयन करें नाम = "कॉपी_एनम्बर" & gt; & Lt;? Php // अब चयनित पुस्तक के आधार पर मैं डेटाबेस से संख्या की प्रतियां प्राप्त करना चाहता हूं $ result = mysqli_query ($ con, "SELECT number_of_copies पुस्तक से जहां isbn = [SELECTE VALUE से ऊपर]"); ? & Gt; मैं यह कैसे कर सकता हूं? आप ऐसा कर सकते हैं और सरल php हैं...

php - How to handle concurrent DB connections by multiple users using PDO in PHP5 -

I want to use the PDO in my application. Although I am confused about the use of PDOs because my application usage targets are numerous users. Let's say it's 100 users together, so, as I read about PDO, it will create a 100 db connection to access. This can cause a problem because it will limit the concurrent connections allowed by the server. And new users will get a connection error. How can I use the PDO in such a way that it handles concurrent connections and does not overhead? 100 concurrent users although this is not an effective number. The average user clicks once a minute, we have 100 connects for 60 seconds, which makes 1.5 connect / seconds. A well written app should no longer be 0,1 seconds. Meaning 10 connections can fit in each other and we have 1.5. Yes, it can sometimes fall on top, but by the way, the number of connections allowed will be the last thing that I will think. Due to improper sequencing and architecture, your database may be killed bef...

ruby on rails - dynamic way to display locally had PDF's in RoR -

I apologize in advance if this is a simple question, although I am confusing myself and I need some help Actually there is a script on my site at this point which: & lt; script type = "text / javascript" & gt; Function Embed PDF () {var Success = New PDFObject ({url: 'Vol_1.4.pdf', '0'}} Embed ("PDF Renderer"); } window.onload = embedPDF; This is great for displaying a PDF, but I would also like to have a page with links to many other PDFs, which I would like to be able to ideally do, that script Is inserted into a method: def is the ideal mode (urlName) // Here is the end of the script written so that on my page Can link all locally organized PDFs, I can get a normal page Can something like Nk am & lt;% = link_to "Volume 1", Pdf_path ,: id = & gt; "Link"%> The above method will take you to the heading "Volume 1" and run the script to open the correct volume 1. Any suggestions...

Why do I get a blank page after uploading a Laravel project to my remote server? -

After uploading my LoreLel project to my remote Linux server, Ubuntu LTS 12.04 loads any page An empty page is changed. / P> In my case it was due to incorrect folder permissions on app \ store Folder. Change permissions on this folder by issuing 777 on the storage folder by issuing chmod-R 777 . Make sure this is ONLY on the storage folder.

html - What kind of template engine uses double underscore enclosure? -

I was asked to continue & amp; CMS modifies the project which is custom made The code taken from one of the files is given below: came from a HTML file above ( form_view.html ). My question is: Do some types of attached in double underscores (like __ myname __ ) Variable ? From where do they get their prices? What type of template engine uses this format? I searched through the rest of the files, but they could not find the connection between the 'variable' and the data they received. I have to parse the code between some php (regex) scripts / P> and replace the token like __% __ in php source and in .htaccess

javascript - update model angularJS -

I am trying to understand how AngularJS works with a directive count-date which calculates the age of months and years, I can not write directly to the data model because I have many fields, but I want to use my code multiple times. HTML: & lt; Div & gt; First child of birth date Month: & lt; Input type = "text" id = "month" first chald "ng-model = 'month before infant' Required maximum length =" 2 "only-digit month Required calculation-date & gt; Year: & lt; input type = "Text" name = 'nickname before year' ng-model = 'first year's balance' maximum-length = "4" only-digit-year-of-year-expected-count-date & gt; & lt; span ng- Model = "AZFst Chald" & gt; {{Edghestchild}} & lt; div & gt; Second child of date of birth month: & lt; input Type = "article" id = "month" second time "ng-model = 'month' second child ...

sql - Different execution plans for Toad and Jasper Report? -

I have encountered a strange situation in which SQL queries take several seconds to complete when running from Todd And a Jasper report takes half an hour (with the same parameters) to generate results of the same question. Here are some details: I checked, and Oracle (version 11g) uses different execution schemes in these two cases. I considered using archived outlines, but the report modifies a bit query (the name of the bind variable is changed; in the case of many values, i.e. $ P! {...} , The report only includes values ​​in the query, and despite this there are many combinations of values), so the settings will not work. I've reported through iReport 5.1 and OpenReports and it takes about 35 minutes for both. The basic questions are tuned with some signals, without them I appreciate any advice about how to deal with it. First of all, do not use the TOAD for query tuning. This is in Tod's interest, to make the application as responsive as possible to p...

nginx - php-fpm crashing -

I run an API using RakeSpace cloud server. For our peak time, we have an auto-level policy and we think that one day or twice a day that the servers roam, they are having problems with php-fpm. As soon as the server starts receiving traffic, all 40 children of it are born and then 502 starts with error message and NGNEX starts. I can monitor the children at the top and they sit idle for about 5 minutes and then eventually die and the server can get traffic again, but then the same process starts and it locks again. . We are running another server that has the exact same disk image, same configuration as it is and it will behave completely. Below is my php5-fpm config. Any help would be greatly appreciated. [www.conf] Listen = 127.0.0.1:9000 pm = Speed ​​pm.max_children = 40 pm.start_servers = 10 pm.min_spare_servers = 10 pm.max_spare_servers = 10 pm.max_requests = 200 php-fpm Check 'listen.backlog' for each pool configuration option (default) : -1 = unlimited). Si...

c++ - Using freeglut without an IDE -

I tried to use freelugs with codeblocks and Microsoft Visual Studio 2010. I tried but still I could not use it successfully. So I tried straight straight out, like the freelog file (by copying it to the folder of my C ++ files): #include "freeglut.h" And then I tried to compile with the GCC compiler through the terminal. It threw a ton of different errors. How can I use freewolt without the IDE? If I can not do that you have any shoe / link that I can install and use? Note Windows 7 32 bit use You are not telling GCC that linking your program to freelit.lib. Compile your program with flag -lglut

android - Problems with serializable java -

I am trying to implement serializable in Java, but I get an excepcion. This is my serial category: Public category serialization java.io.Serializable {Private Static last long serial VERSIONUID = 1 L; Public double dis1; Public double dis2; Public double error 1; Public double error 2; Public double coaches; Public Double Corpus; Public Double Coorg; } And when I try to create this square object and convert it to bytes. Serialize serial = new Serialize (); Serial.dis1 = dis1; Serial.dis2 = dis2; Serial.error1 = error1; Serial .error2 = error2; Serial.coorx = coorx; Serial = korean; Serial.coorz = Coeur; Byte [] bytes = null; Int length = 0; Try {Bitherean OutputStream BS = New BytereOutStream (); ObjectOutputStream OS = New ObjectOutputStream (BS); Os.writeObject (serial); /// EXCEPCION os.close (); Bytes = B.T.Bitere (); Length = bytes Lamps; } Hold (IOException e) {e.printStackTrace (); } What am I doing? Logcat: 04-24 09: 15: 29.734: W / System Err (4279): jav...

grails - Search records bases on latest record in a hasmany relationship -

I have two domains class domains {string name date date sorted date last update Fixed Static = ['Email'] is static Haimyanya = [domain BS: domain B] public string getEmail () {DomainB.mostRecentRecord (this) .get () ?. Email}} and class domainb {String Email Date Date Created Date Last Updated Stable Stability = [Domain A: DomainA] Static nameQueries = {Most Recently Recorded {domainA - & gt; Eq 'domainA', domainA order ('dateCreated', 'desc') maxResults (1)}}} I need to get a list of all domains whose name starts with The "M" and latest domain B's records contain Gmail in their email properties. I tried createCriteria and hql but did not get the desired result, maybe I'm doing something wrong. The following is my current code list & lt; Domain A & gt; listA = DomainA.findAllByNameIlike ("M%") list & lt; DomainB & gt; ListB = [] list a.each {entity -> DomainB domainB = Domain...

ios - Custom header view overlapped by UITableView -

Image
In the interface builder, I have header view above the UITableView, although it is missing in the simulator, and the table looks on it Is there a reason for taking more and more screens? Work around? Interface Builder Simulator In your case: Interface Builder Image I can see that the table view is a view of the view and you are also the subview of the header view tableview. This is happening because tableview header is hiding the view. If you add the header view as a view of the table view, then it will appear. But adding the subviews will not solve your problem as the subview will go away when you scroll through the table view. To solve your problem, I can see that your table view has a navigation bar header view as a subview of novelist . [self.navigationController.view addSubview: headerView]; Good practice: Set the header view for the section after you set any custom view at the top of your table view do not require. Try it: - (UIView *) Table...

HTML, PHP and javascript -

इस सवाल का पहले से ही एक उत्तर है: 5 जवाब मैं php के लिए नया हूँ, Html और जावास्क्रिप्ट। मैं अब भी तीनों के बीच के संबंध को समझ नहीं पाया। तो यह मूर्खतापूर्ण लग सकता है मुझे पता है कि php एक सर्वर साइड भाषा है लेकिन यह तथ्य मेरे लिए बहुत स्पष्ट नहीं है क्योंकि हम एचटीएमएल के अंदर पीएचपी कोड का उपयोग कर सकते हैं। तो मेरा सवाल यह है कि क्या मैं निम्नलिखित लिखा, जहां हिस्सा चल रहा है ?? क्या कोड का वह टुकड़ा क्लाइंट ब्राउज़र को भेजा जाता है और क्लाइंट साइड पर इसे निष्पादित करता है? या सर्वर साइड पर निष्पादित करें और क्लाइंट साइड पर परिणाम अपलोड करें? & lt;! DOCTYPE html & gt; & LT; html & gt; & LT; बॉडी & gt; & Lt;? Php echo "मेरी पहली PHP स्क्रिप्ट!"; ? & Gt; & Lt; / body & gt; & Lt; / html & gt; यह सर्वर पर चलाया जाता है, आउटपुट HTML को क्लाइंट को भेजा जाता है, और आपका ब्राउज़र इसे प्रदर्शित करता है।

mongodb - Updating array with push and slice -

I have just started playing with Mangoodi and there are some questions about how I update my documents in the database I am I insert two documents in my DB with db.userscores.insert ({name: 'John do', email: 'john.doe@mail.com', level :) I [[Level: 1, Haakors: [90, 40, 25], Aquimant: ['Flag capture', 'It can only be one', 'apple collector', 'level complete']}, {level : 2, Haakors: [30, 25], achivements: ['full level']}, {level 3, helicopters: [], achivements: []}]}); Db.userscores.insert ({Name: 'Jane Doe', email: 'jane.doe@mail.com', Level: [[Level: 1, Helicopters: [150, 90], Achievements: ['Master of the Universe' , 'Capture the flag', 'this can only be one', 'apple collector', 'level full']}]}); I check that my inclusion has worked with the find () command and it looks okay. db.userscores.find (). beautiful (); {"" "Email"): "john.doe@...

for in loop behaving strangely in javascript -

var buddy = ['2', '3']; console.log (friend); var room = []; (Different friends in friends) {var room = 'userid' + friend + 'friend'; console.log (rooms); Rooms.push (rooms); } Console.log (cell); User ID - Video Friends User's Friend ['userid0friends', 'userid1friends'] This output ['2', '3'] User ID- / Code> 3 is completely neglected, and this is my node. JS behaves more odd on the server friends here's your array Index, there is no value on index var room = 'userid' + friends [friends] + 'friends'; Plus when looping through an array, I do not recommend using for..in loops, you can see the Array.prototype.map You can use or limit the length of your array for the loop Map of the array example: var friend = ['2', '3']; Console.log (friend); Var room = friends.map (function (friend, index) {return 'userid' + friends + 'friends';}); C...

Regex - match a word and capture that word -

मेरे पास एक HTML पृष्ठ में निम्न कोड है: src = "/ images / Picture1.gif "ONMOUSEOVER =" आइटम पॉपअप (घटना, '69168298' src = "/ चित्र / तस्वीर 2। Gf" ONMOUSEOVER = "आइटम पॉपअप (ईवेंट, '69168223' src =" / चित्र / चित्र 3। Gf "ONMOUSEOVER =" आइटम पॉपअप (इवेंट) , '69168243' src = "/ images / picture4.gif" ONMOUSEOVER = "आइटम पॉपअप (ईवेंट, '69168249' src =" / images / pic1.gif "ONMOUSEOVER =" आइटम पॉपअप (ईवेंट, '69168249' src = "/ images / चित्र 10.gif "ONMOUSEOVER =" itempopup (घटना, '69168249' और मैं जीआईएफ के शब्दों के साथ एक मानचित्र बनाना चाहता हूं, जिसमें तस्वीर + संख्या है - & gt; {picture1 = 69168298, चित्र 2 = 69168223 ...} मैंने तस्वीर की तस्वीर + संख्या पर कब्जा करने की कोशिश की है, लेकिन मुझे सही संयोजन नहीं मिला। उदाहरण: ^ (चित्र।) + $, ^ ((चित्र)।) + $, ^ (? 'तस्वीर'।) $ अग्रिम धन्यवाद! यही कारण है कि आपके स्ट्रिंग ...

matlab - Sum value in array with pervious values and place it in new matrix -

I have an array [1; 2; 3; 4; 5]. I want to add every value with the previous values ​​and want to create a new array like this: [1; 3; 6; 10; 15] The real matrix is ​​bigger than this and has more than 2000 values. You are looking for a function.

android - how to create layout for registraion mobile number -

Please, I have to make a layout to see this image but I am unable to do this, especially in the Android control set Please help me .. I am capable of displaying control in Android: Gravity is not below but fixed as my control image. Please check me where I am wrong. Here is my XML file code: & lt; Fremleaut xmlns: android = "Http://schemaskandroidkcom/apk/res/android" Android: Layout_width = "Match_parent" Android: Layout_height = "Match_parent" android: background = "@ drawable / Rjistrioimej" & gt; & Lt; LinearLayout Android: layout_width = "match_parent" android: layout_height = "132dp" Android: layout_gravity = "bottom" android: orientation = "vertical" & gt; & Lt; Spinner android: id = "@ + id / spinner1" Android: Layout_width = "Match_parent" Android: layout_height = "49dp" Android: entries = "@ array / country_arrays" android: promp...

C++ pure virtual method implementation by other class -

बाहरी पुस्तकालय से आता है ए वर्ग को देखने देता है वर्ग ए {सार्वजनिक: शून्य विधि () {cout & lt; & lt; "नमस्ते"; }}; और मेरा वर्चुअल क्लास बी शुद्ध वर्चुअल विधि () वर्ग बी {सार्वजनिक : वर्चुअल शून्य विधि () = 0; }; मैंने A और बी कक्षा डी: सार्वजनिक ए, सार्वजनिक बी {}; लेकिन जब मैं डी का एक उदाहरण बना देता हूं, तो मुझे निम्न त्रुटि मिलती है: त्रुटि: चर को घोषित नहीं कर सकता ?? ?? दा ???? यह सार सार तत्व नहीं था और यह विधि को कॉल कर सकता था। () वर्ग से ए ? नमूना कोड: आपको विधि में डी ओवरराइड करना होगा। आप इसे ऐसा कर सकते हैं वर्ग डी: सार्वजनिक ए, सार्वजनिक बी {सार्वजनिक: शून्य विधि () ओवरराइड {ए :: विधि (); }};

c# - Location of calls to SQL SP in controller -

text = "post-text" itemprop = "text"> Newbie here again I got a controller in C #, I need to call SQL, I feel a lack of formatting skills. namespace invoiceViewer.Controllers {public class invoice controller: API controller {& lt; Region One & gt; } & Lt; Region Two & gt; } Should my phone be spotted in one or two areas? If two, then am I away from that class? Please forgive me if this is a stupid question, then I'm learning C # for a week. In your question, you propose to put the code inside the class definition that will not work. Most patterns have data access layer, which is used to call databases and updates / get data from it, for example: namespace invoiceViewer .DAL {public static class invoicedale {public static foo GetFooData () {// DB access code goes here // get data // return data; Then in your category: namespace invoiceViewer.Controllers {public class invoice controller: ApiController {public invoice co...

xmpp - Java - trying to prebind converse.js using bosh but not able to get the sid and rid...using the smack bosh -

I am trying to connect to open fire using Scout Bosch and pre-bind to converse.js in web page I am trying to do My Bosch code BOSH configuration config = new BOSH configuration (false, "host", 7070, "/ http-bind /", " ", "xmpp: 127.0.0.1: 5222 "); Bosch Connection Connection = New Bosch Connection (Config); Try {connection.connect (); connection.login ("United Nations", "PW"); String sss = connection.getConnectionID (); String Bosch = Connection. BOSH_URI; } Catch (Exception E) {} How can I install a bosh connection and get the necessary CD, rid and jade from the session .... Any help is greatly appreciated. I managed to do this by adding the following work to Skak Bosch Connection Library Category: increases the public class BOSHConnection connection {... public string getSid () {return client.getSid (); } Public Long Mill Rights () {Return Client.Get Arid (); } ...} You should then remember that the las...

java - Multilenguage data in web application -

I am developing a web application about restaurant management, and I want to store different categories and my language Election. I am using my SQL and my application has been developed in Java + Spring + Hibernate + Tapestry. how can I do this? Store names in databases in three or four languages? OK I calculate my answer here and describe some details, Was not included in. Create. * Properties file that you plan to use. For example their content: I18n_en.properties category.dinners = dinner I18n_es.properties category.dinners = babidas The user clicks on the button or link on the site, and the server receives the request-parameter, for example locale = n. The code can be anything to create a site-page: string path = ...; // --- * .properties paths of folders with files if (locale.equals ("en")) path + = "I18n_en.properties"; Other path + = "I18n_es.properties"; FileInputStream fis = New FileInputStream (path); Resource bundle...

Change SiteLogo via csom in SharePoint 2013 -

Regarding this question How can I change a new logo to a site? Is it possible to do this through a consoles application via CSOM? post-text "itemprop =" text "> It appears that the client object model does not have any hook in the site logo such as the regular object model ( site.RootWeb.SiteLogoUrl = pictureUrl; )