Posts

Showing posts from June, 2010

ruby on rails - How can I Make multi select in simple_fields_for -

I've written the following to accept roles, how many values ​​can it be accepted = f.simple_fields_for: content_roles | Role | "Role", collection: rolls all, required: true just your role area Add multiple: true to Like this: = role.input: role_id, label: "visible to", like: select, label: "role", compile: roll .all, required: true, multiple: correct

closures - is it possible to make the "value" self-increase in setTimeout() method in Javascript? -

Is it possible to self-increase "value" in the setTimeout () method in Javascript? My code looks like a code block below I have two for loops in the init () method, and in the internal loop I apply "1 myfun = function testfunc (year, value)" every 1 second Function to " but I still have a feature called" value "which 1. I want" value "to be extended every time, < / P> 2. Or make changes to "value", then the next time this function has been applied "var myfun = function testFunc (year, value)" then Or "value"; But now I get in the function "my myfun = function testFunc (year, value)" I can get the year [data] properly, but " Value "is always the same. Did the" value "or every time change? Really appreciate any help or answer. ... init (); Function for init () {... var (= var state in dataset) {var i = 0; Var for value = 18; (different year in the dataset [stat

java - Get the name of file as parameter in a batch application -

I have created a batch file that passes some arguments to run a jar file. I want that when I have a Jar file, then it should be taken as an argument. But when I do this, it only runs the batch file and does not take the file as an argument. Please help me The way to do this is: < / Pre> As Alex K. has said, % 1 is the first operator provided to the batch file. < % 1 is the value of the file name when the file is dragged into the batch file.

php - Use phpcassandra in codeigniter -

Hello I am new to the Kassandra database. I am trying to do a project in the coordinator with the Kosindra database. I have downloaded phpcassandra files through the link given below. When I'm trying to automatically load my casssandra.php in the codeigniter, I could not find any existence: Cassandra error Why did I get this error and how to resolve this issue? You have to create a cover for this if you want to use it as a library. I suggest that you take the route. You can check out a suitable library. If you use this special library, then in this way you will have to go to work in Codeigniter. composer.json {"require": {"php": "& gt; = 5.3.0", "thobbs / phpcassa": "1.1.0 "}} index .php " ../composer/autoload.php "is required; system / core / codeigniter.php // where the codiginator starts to load the main controller // $ cassandraDB will be in global scope, therefore You can write a cov

class - Calling a Lua function from within an object instance -

"itemprop =" text "> I think that creates a scene and within the visual function it creates a deck object and a function is wonGame A main lua file () that checks the play when the game has won local musician = ("composer") function view:. "Deck" myDeck = deck: New () function wonGame () print ("You have won the game") and end My question - I need deck class How can I call the function () within the file? For example, I have a function deck class function checkCondition (e) if (somethingTrue) wonGame () --This main file should be the end function at the end You can always try and apply a representative to ex: Basically this means you have a property in the 'deck' which combines back into 'view' when you make your deck you will decide something like < Deck.SceneDelegate = self Then you can just say in the deck View the scene. Von game ()

javascript - MySQL Event update on every snapped 5 min -

मैं निम्नलिखित MySQL घटना का उपयोग कर रहा था तालिका (CURRENT_TIME) +5) के साथ तालिका अद्यतन करने के लिए हर पांच मिनट यद्यपि मेरी योजना है कि उस समय के साथ अद्यतित तालिका प्राप्त करना वर्तमान समय से हर 5 मिनट तक होता है: जैसे, 12:05 पर 12:10 लिखता है, 12:10 पर यह लिखता है 12:15 ... तो मैं आग लगाता था नीचे दिए गए घटना को ठीक से प्राप्त करने के लिए 12:30:00 बजे उदाहरण के लिए। कार्यक्रम चालू करें x_next पर प्रत्येक 5 मिनिट स्टार्ट्स CURRENT_TIMESTAMP करें डेटा सेट करें x_next = CONCAT (CONCAT (HOUR (CURRENT_TIME), ':'), मिनट (CURRENT_TIME) 5); मैं अब जो देख रहा हूं, वह इस घटना को निम्नलिखित जेएसएफडल परिणाम की तरह बनाने के लिए अधिक सटीक बनाने के लिए है, जहां भी किसी भी समय शुरू किया गया है, यह अगले 5 मिनट में केवल अपडेट होगा ( snapped-to): जहां घटना को अपडेट किया जाना चाहिए उसका परिणाम होना चाहिए। मैं सोच रहा हूं कि किसी को इस अनुभव से पहले या कोई सुझाव है? इसके बजाय प्रारंभ समय को परिभाषित करने का प्रयास करें current_timestamp प्रत्येक 5 मिनिट स्टार्ट्स के ल

debugging - Restore memory dump -

If a computer is in trial without a debugger, then a client's computer says, a bug has arrived This program may be messed up actually did not crash, I know that I can take a memory dump using Windows Task Manager (right click on the correct name, create a dump file). I can peep around in memory with WinDbg, etc., but what would be most useful to me to restore the dump to memory so that I can communicate with the program. Is this possible? if so, how? Is there a device that can restore it or I need to write it myself? Typical usermod dump or minidump does not have enough information to do this though they are all wormodode memory , They do not have kernel memory, so open handles to kernel resources such as files or network sockets will not be included in the dump (and even if they were, the probability of hard disk is also the most replaceable, hence hard Write your disc to your system Can be corrupted more). The only way to restore a memory dump is to restore the entir

c++ - Deep copy of CImage object causes debug assertion failed -

I have a problem similar to this problem: I need to make a deep copy of the CImage object. The specific problem is that I am getting CIMEZ * from a secondary thread through PostMessage, and it is a copy of the CIEISE object that is characterized by different classes. I currently have the following code: LRESULT CMainFrame :: Transchange Transpole (UINT Vermom, Long Laparam) {DB ("Message Received \ n"); // This debug message is CImage output * ObraZel = (CImage *) wParam; Int a; CSTering T; Seymour Timzza; Obrazek- & gt; Save (_T ("mesydz.jpg")); // If the image is valid DEB ("o1 \ n"), check it; obrazek-> GetDC (); PointerToViewClass- & gt; Przetransformowany.Create (obrazek-> GetWidth (), obrazek-> GetHyight (), obrazek-> GetBPP ()); Deb ("o2 \ n"); obrazek-> BitBlt (PointerToViewClass-> przetransformowany.GetDC (), 0,0, SRCCOPY); // logger-> Release Dadi (); Deb ("o8 \ n"); PointerToViewClass- &a

android - Run Lint from console for only selected files -

I am trying to create a custom Git pre-commit hook which can be lit from the console ("gradlew" Using Lint) Potential issues However, I can not find how to run lint only in the provided files if I run something. ./ gradlew app: lint Lint analyzes all project files, and this operation can take quite a while. In, there is a "incremental lint" section, in which something does cover anything like I see. I have also come to know that it is similar to my problem, but seems more specific because it is "automatically" files lined up. In short: Is it possible to run the lint from the command line on the collection of files? Or am I worried about running it for the entire project? Best Relationship A dedicated Lint CLI Available, which allows to see special directories / files [1]. Example: Lit The Directory Search / lint or OneParticularFile.xml - Check Together you are also free to limit the checks you are being given. See lint --he

javascript - pass openid-connect oauth2 bearer token in header -

पृष्ठभूमि मैंने Thinktecture.IdentityServer.V3 को लागू किया है ( ओपनआईडी कनेक्ट एक)। मुझे अपने जावास्क्रिप्ट क्लाइंट (अप्रत्यक्ष प्रवाह) के रूप में वापस OAuth2 वाहक टोकन मिला है: {"id_token": "eyJ0eXAiOiJKV1QiLCJh ...", // JWT "access_token": "", "राज्य": "1299139105028949"} " / Pre> लेकिन सभी उदाहरणों में वे सेवा को बुलाते समय संसाधन प्रदाता के access_token पास करते हैं। $ .ajax ({url: 'http: // localhost: 2727 / खाता / 123 / जाओ ', हेडर: {प्राधिकरण: "बीयरर" + $ scope.response.access_token}}) धारणा < p> अगर मुझे यह अधिकार मिल गया है, तो मैं पहुंच टोकन के साथ प्रमाणन करता हूं। तब मैं id_token (मैं एक अलग डीबी कॉल नहीं करना चाहता - मैं इसे पूरी तरह से आत्म निहित करना चाहता हूँ) में दावों के आधार पर अधिकृत है। प्रश्न मैं कैसे इस जानकारी को मेरे वेबपिया 2 समापन बिंदु को एजेक्स के माध्यम से पास कर दूँगा (मान लें कि मैंने सीओआरएस आदि की स्थापना की है) और मुझे यह मान्य

android - create/find java class with simple constructor (hour, min) for use extending GregorianCalendar -

I want to store a specified time of day (unspecified date) in Java object. Can I install a local time object and set my hours and minutes in a row of Java code? Or is there a different, more suitable current class? I have a lack of Google search to do this kind of exploration in detail like this, and thank you: & lt; 1 year Android / Java XP I am expanding the Gregorian calendar category and coding a constructor for futural which takes the integer hours (0-23) and minutes and matches the first future event of the day Calendar-ish returns the date / time of the time: minutes (either today) or tomorrow - for notification / reminder content). To allow for other manufacturers, which can be two integers, I would like to use or create a timeoffade class / type (hours and minutes of integer) and instead of the parameters for my constructor, that I would like to use Is this a) possible B) is appropriate? Thanks for your time. add-on The library is well-publicized for a popul

c# - TypeDescriptor.GetProperties from property in another class -

I am using GetProperties to get the property file with the map PropertyDescriptor descriptor = TypeDescriptor.GetProperties (GetType ()) [attrNane]; But is it possible to get property descriptor from another class? Example class a {The name of the public string; } Class B {public B () {property descriptor descriptor = type descriptor. GetPyPerties (GetType ()) ["a.name"]; } } So I want to get property name from "name" class propertyDescriptor > A . Is it possible anyway? You can get a type another category. get class {public string name}; Set;}} class B {public B () {property descriptor descriptor = type descriptor. GetProperties (typef (a)) ["name"]; } Note that I have converted a.name into a property.

sql update - First time Updating a table -

I was recently allowed to update a table in our database, but this is not something I have previously And I do not try to mess up anything, I tried to search something online which is what I want to do with success. The name of the table is dbo.Player_Miles and it has only two column data data_ID and miles which are both set (int, null) currently in this table There are about 300 records and I have a CSV file which I have to use to update this table. There are 500k records in the file so I need to be able to: enter new record ~ ​​250k records Update the records that have new information ~ 200 records < / p> leave the untouched and record which is the same information (though updating the same things will not harm the database, which I would think) ~ 50 records Anything other than Leave the record currently in the table Which are not in the update file ~ 50 Records I am using Ssms 2008, Server 2000. You can contact this step ... 1) Backup Database 2) Crea

javascript - jQuery in Sublime text? Code not working -

I'm thinking if you can help I see my code in Firefox Build System using Subleam Text 3 I am HTML and CSS are fine but despite being properly linked, my jQuery does not work. Here's my code: I've just seen one thing, you're adding the class and immediately It has to be removed on the hinges so div is unaffected Try this code, if you are just trying to add the class to the hover and remove it when it is not deleted $ ('# manifesto'). Mouseover (function () {$ (this) .addClass ('manifestotitle');}). Mouse Out (function () ($ (this) .removeClass ('manifestotitle');}); For reference refer to the following jsfiddle: Hope this help

jquery - Datatables encode HTML -

code> is used. Unfortunately, I got a serious security problem, i.e. XSS (cross-site scripting). The server returns JSN data and the client loads the data without any scope. How can I save the table before loading it in the table? There is a callback function to manipulate table row elements after the row has been created. $ table = Data-worthy :: table () To generate this function, I used the Chumper / DataAbout - & gt; AdKum ('id', 'username', 'name', 'email', 'actions') - & gt; SetUrl (from URL :: ('admin / users / data')) - & gt; SetOptions (array '(aoColumns' = & gt; array (array ('sType' = & gt; 'numeric'), empty, empty, zero, array ('bSortable' => ()) - & gt; ; ("Td: eq" (+ "+ i +") for set callback ('fnCreatedRow', 'function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {{var i = 1; i & lt; 4; i ++

apache - Prevent rules conflicts with htaccess' RewriteRule -

मैं रूपांतरण के लिए कुछ RewriteRule s का उपयोग करना चाहूंगा: < Li> = & gt; index.php? Id = blah = & gt; index.php? Id = blah और उपयोगकर्ता = किसी यहां एचटीएसीएसीएसी है: < पूर्व> & lt; ifModule mod_rewrite.c & gt; RewriteEngine RewriteBase / RewriteCond पर% {REQUEST_FILENAME}! -f पुनर्लेखन कन्वर्ट% {REQUEST_FILENAME}! -d रिक्राइटआर्यूल ^ (। *) $ /index.php?id=$1 [L] RewriteRule ^ (। *) / (। *) $ /index.php?id=$2&user=$1 [एल] & lt; / IfModule & gt; लेकिन ऐसा लगता है कि दो अंतिम नियम असंगत हैं: इस htaccess के साथ, मुझे कुछ 500 आंतरिक सर्वर त्रुटि मिलता है। कैसे दो नियम बनाने के लिए कि वे एक-दूसरे को "ओवरलैप" न करें? नोट: इनमें से प्रत्येक 2 नियम अकेले काम करते हैं जब मैं दूसरे नियम का उपयोग करता हूं, तब = & gt; index.php? Id = blah और amp; उपयोगकर्ता = कोई काम करता है, लेकिन ऐसा लगता है कि रूट फ़ोल्डर अब / नहीं है, लेकिन / किसी / और तो सीएसएस नहीं मिला ... इस मामले में बेस फ़ोल्ड

node.js - Receiving Leap data from WebSocket server to Unity3D directly -

I try to make a connection between Leap Motion and mobile devices in Unity 3D, through node. Js. There are two examples that make me node. Found online using JS, and Now, I have successfully obtained data from Leap Motion in this process: Receiving JSON-formatted messages from "localhost: 6437" in node.js received Parsing and writing Reading stream from the port: 8000 in Unity 3D However, I wonder if it is possible that data on any other port (i "localhost : 8000 ") to get data directly from" localhost: 6437 "? So probably does not require node.js I tried to write in C # using the TCP client, but when I check "NetworkStream.DataAvailable" it returns false. Thanks for your help. For this you will need a webserchant client, not a TCP client.

vb.net - Visual basic membership program using select case? -

I am writing a program that asks the user for their age and the number of years that they are members, I Trying to do this by using the selection case, though it does not seem to work, all ages are okay but if I want to use the checkbox to say that he is an elderly and should get a discount That's not working. Also, in the years in which they are members, their price / category does not change, my program is simple and I am not sure why this is not working. The program's screen shot: Code: Public class form 1 personal sub btnCalc_Click (System.Object, System by System Avent ARG) by BTNCL X = wal (txtAge.Text) select y = val (txtYears.Text) Case x is the case & lt; = 18lblPrice.Text = ("£ 60") lblCategory.Text = ("Junior") Episode 19 to 49lblPrice. Text = ("£ 120") lblCategory.Text = ("senior") episode> gt; = 50 lblPrice.Text = ("£ 80") lblCategory.Text = ("more than 50") case chkVeteran. Checked LblPr

asp.net - How to check which control fired in Master Page -

How can we get control that is removed inside a master page in which a panel of code behind it is also? I have the following layouts. Master page + --------- Panel ----------- + | Text box button 1 button. + ------------------------- + | -------- & gt; Child page + ------------------------- + | Get out of here! | + ------------------------- + When I try the following the target id is empty < / P> if (IsPostBack) {var targetID = Request.Form ["__EVENTTARGET"]; If (targetID! = Null & targetID! = String.Empty) {var targetControl = this.Page.FindControl (targetID); }} I have to find out which button was posted back. **** Update **** I tried the following link without success. You event is your master page Offer to communicate with the page. Create something like this in your masterpiece public event EventHandler Button1ClickEvent; Public Event EventHeader Button 2 CLAEvent; What's happening here is that you are creating an ev

Php namespace - repeating Use in each class -

I sometimes have classes in subfolders that I am loading using this auto loader: < Pre> Spl_autoload_register (function ($ square) {$ class = str_replace ('\\', DIRECTORY_SEPARATOR, stroller ($ square)); if (file_exists (FILES_PATH.'classes /'.$ class'. Class.php ')) {Need_once (FILES_PATH.'classes/'.$ class'. Class.php')}}}} So if I do new folder / subfolder \ Myclass, So this works. The squares in folders are all in a namespace. All of these sections The database class should be used, and here's the problem: when the class is in a namespace and the database finds the square, it can not be found. (The DB class is in the global namespace) / P> So I try to use "use BDD" (BDD is DB square) and it still does not work, because BDD is using PDO and therefore I am "bdd, pdo; Should use "; in every class of the project ... < P> I find this stupid. Is this normal? What's the better way to auto-l

linux - Two OwnCloud instances on the same server -

I want to keep my data in an encrypted and encrypted form (more sensitive data) in both OwnCloud. As far as I know, Oncloud can specifically encrypt "all or nothing". Because of that, I have two OC instances on the same physical server. How can I configure Apache server and OwnCloud to operate with two examples? Any examples? I use the Oklawwad version 6.0.4 on the Magazine VERS3 server. You can only have two different virtual hosts, two separate databases and two separate autocomplete data With directories. & lt; VirtualHost *: 443 & gt; ServerName Secure-owncloud.your- Domain DocumentRoot / var / www / secure-owncloud & lt; / VirtualHost & gt; & Lt; VirtualHost *: 80 & gt; ServerName Unsecured-owncloud.your-domain DocumentRoot / var / www / unsafe-owncloud & lt; / VirtualHost & gt; You must also add the https configuration, and make sure that each AutoCLD (secure and non-secure) has different data-dir (ej. / Var / unsecured-dat

Massive css file, or single file for each page? -

I am thinking that I should have a CSS file that covers many pages, or if I have CSS The file should get the page? In both cases there will be only one HTTP request for a CSS file. I really like 1 css all my sites because I think most of the tips between them I can use it again. I just shortened the style and applied several styles

php - I am trying to verify the state of $_SESSION to allow access to a web page and it is not working -

On the page the following code will be the only redirect: Here is the code that I'm trying to At the top of other pages, I want to check S_SESSION before allowing login permission: My code for the login page here: 0) {$ row = mysql_fetch_array ($ query, MYSQL_ASSOC); $ user = array ('Userid' = & gt; $ row ['userid'], 'email' = & gt; $ row ['email'], 'accesslevel' = & gt; $ row ['accesslevel'], 'password' = $ Session ['password']), 'enabled' = & gt; $ line ['enabled'],); // session session_start (); $ _SESSION ['login'] [] = $ User; top ('Location: message.php'); ob_end_clean (); exit ();} and {header ('location: login_redirect.php');}} and {print '& lt; p & gt; please make sure That you enter both an email address and password! Go back and try again. ';}} Else {print' & lt; form action = " login.php "method =&q

unix bash: separating a specific column into multiple columns -

I have a tab delimited file with three columns, in each column in the third column, there is a string with 4 names, each Is separated from space (''), but in some cases more than one place is separated between names. I want to use a Unix-Bash command line to print all the columns divided by tab 1, column 2, name 1, name 2, name 3, name 4, name 5, tab. My intended output will look like this: avov2323 [tab] rogoc232 [tab] roy [tab] don [tab] mike [tab] ned [tab] Cdso3432 [tab] fokfd543 [Tab] Tom [Tab] Gill [Tab] Rose [Tab] Dan [Tab] Sam Is there a way to store all of my column 3 Is this specific variable divided based on a variable and after the empty space? Something like this: a = awk -F "\ t" '{print $ 3}' file.txt ; awk -F "" '{print $ 1}' $ a; However - this command line does not work for me ... because all the names in column 3 $ $ fed each other in $$ Use tr to translate: < pre> tr & lt; Input file &qu

web scraping - Python mechanize form submitting doesn't work -

I am trying to write a simple bot which will enter my account on a page and then images from other users Will comment on Although I am not able to get the comment form to present the work correctly. The comment form looks like this: & lt; Form id = "comment-form" action = "#" onsubmit = "post comment ($ (this). Serialize (), 'image', 117885229227); returned;" & gt; & Lt; Input class = "comment" type = "article" size = "40" name = "comment" id = "comment" /> & Lt; Input type = "hidden" name = "comment obz" value = "9234785" /> & Lt; Input type = "hidden" name = "comment mode" value = "image" /> & Lt; Input type = "hidden" name = "user id" value = "12427" /> & Lt; Input class = "submit" type = "submit" value = "comment" /> & Lt; /

Need to pass long text variables from JavaScript to PHP -

Amateur here ... I have an SSL query, need to pass the variable on the JS page and on a PHP webpage I know how to pass more simple variables through the URL, but I'm struggling to find and implement the most efficient way to pass a long string, i.e. the text description of a point Here on the JS side, I have: downloadUrl ("php_genxml1.php") Maroh (data) {var xml = data.responseXML; on Issue = xml.documentElement.getElementsByTagName ("point"); (For I = 0; I & lt; points.length; i ++) {var ID = [I] .getAttribute ("id"); var name = number [i] .getAttribute ("name"); description = number [i] .getAttribute ("description"); var url = "? PHPWebPage.php Name = "+ name +" & id = "+ id; To get the ID from uRL, I have used the stuff like standard $ id = $ _ receive ['id']; I know that I can run a closed based query again this url The ID, but it does certainly not the most efficient. Whatev

javascript - Placeholders in Phalcon -

I am used for ASP.NET MVC, where I can define a section in the razor scene: / p> @ html.RenderSection ("script") I usually put it at the bottom of my layout view. Thus, I can add scripts to my thoughts in this way and under the body, where the script section is defined, it will be included: @section scripts {& lt; Script & gt; (Function () {// do stuff ...} ()); & Lt; / Script & gt; } In the Falcon, I can put it in the bottom of my layout view: $ this-> assets-> outputJs (); Then I can add script to my thoughts like this: $ this-> assets-> AddJs ('js / whatever.js'); The only downside of this method is the script for this view in a separate file, which means a different request. I would like to add the script directly to the scene, as I can with the razor and still have it provided in the lower part of the body. Does the Falcon allow you to do this? Yes, you can use it: & lt ;; Php $ this- & gt;

Get full respository specific version from CVS -

कमांड का उपयोग cvs -d & lt; दूरस्थ सीवीएस cvsroot का स्थान & gt; चेकआउट & lt; मॉड्यूल नाम & gt; -r & lt; मॉड्यूल संस्करण & gt; केवल मुझे & lt; मॉड्यूल संस्करण & gt; प्रतिबद्ध से संबंधित फाइलें प्राप्त करती हैं, जो कि ब्याज के भंडार का एक अंश है। मैं पूरे परियोजना को कैसे चेक कर सकता हूं क्योंकि यह & lt; मॉड्यूल संस्करण & gt; प्रतिबद्ध के बाद था? मैं सचमुच कोड चाहता हूं - चेकआउट करने के बाद किसी भी चीज को करने की आवश्यकता नहीं है। अपडेट मेरा वर्तमान समाधान वैकल्पिक डेटा की तारीख को-डी फ्लैग का उपयोग करने के लिए है विशिष्ट संशोधन, लेकिन यह उचित ही लगता है जितना clunky थोड़ा < p> तो जितना ज्यादा मैं इसे देखता हूं उतना मुझे लगता है कि ऐसा करने में मेरी अक्षमता मेरे हिस्से पर अर्थ समझ की कमी है। ऐसा लगता है कि सीवीएस में, फ़ाइलें के संस्करण हैं, पूरी परियोजना नहीं कुछ संस्करण से जुड़े परियोजना के लिए पूछना एक अतर्कसंगत विचार है इसके बजाय, -D विकल्प का उपयोग करना जो मैं चाहता हूँ प्राप्त करता है, और लगता है कि, य

powershell script to show git info and just the working directory -

Image
I got some goggles and got a solution, so I was expecting some help here. I have installed POSH-GIT to use with power-shell and want to continue the GIT status which adds to the prompt line, but I do not want to print the entire working directory because Its annoying I just want the current folder Ive received the code to each, but they have not figured out how to combine them. Default POSH-GIT path and GIT information is printed function global: prompt {$ realLASTEXITCODE = $ LASTEXITCODE # Reset color, which is enabled by host $ GitColors Can be messed up. UI.RawUI.ForegroundColor = $ GitPromptSettings.DefaultForegroundColor Write-Host ($ pwd.ProviderPath) -Nineline -VCSStatus $ Global: LASTEXITCODE = $ REALLASTEXITCODE Return "& gt;"} The path to print the current folder in the path is function prompt {'PS' + ($ Pwd -split '\\') [0] + '' + $ (($ pwd) -split '\\') [- 1] -Join '\') + '& gt; I tried many

java - JavaFX 8: rendering messed up on Linux -

There is two links to the Oracle's Java FX "Hello World" example screenshot on my Debian VG workstation. > The first one is built with a 1.7 target with JDK6u67, and running with the related JRE: The second one with the 1.8 goal was created with JDK8u20 And run with this JRE. As you can see, rendering at Java 8 is very wrong. Note that the nice app icon has been replaced by the X server icon in another screenshot. It may be worth it, it is also worth noting that running on "good", that is Java 7, Java 8 is also awesome. Either the construction work is fine on Windows. Can anyone be wrong? Some information about my system: $ X -version X.Org X Server 1.12.4 Release Date: 2012-08-27 X Protocol version 11, Revision 0 Construction Operating System: Linux 3.11-2-AMD 64 x86_64 Debian - Current Operating System: Linux Bases 3.2.0-4-MD64 # 1 SMP Debian 3.2.6 0-1 + deb7u3 x86_64 Kernel Command Line: BOOT_IMAGE = / vmlinuz-3.2.0-4-amd64 Root = / dev

php - Braintree dropin UI : validate billing address custom fields before form submit -

I have set up a drop-in UI in my checkout page but I also accept the customer's billing and shipping address. Before submitting the checkout form of Want to Drop-in UI Card It automatically creates a snarl from the server and adds it to our form, but how can I validate the drop-in and address fields at the same time? / P> I work in Braintree on the JS SDK team. Currently, drop-in does not allow for farms beyond credit card, termination, CVV and postal code. However, it is designed to work in the context of your checkout form. If you want to stop the drop-in from submitting yourself, you can run your own verification once you are not produced, you can define the callback in your configuration and then if you are satisfied you can With your results you can manually resubmit You must remember that an input field involves including a name that your server requires is the default payment_method_nonce . For example: braintree.setup ('CLIENT_TOKEN', 'dro

javascript - D3.js exit transition: delay has no effectD3 -

I have a D3 bulbart where I am trying to get the selection of the text in the bubble so that Delay code for removal of tasks done; But there is no effect of the delay ... the sequence of code below deals with the removal of delay (1); All other changes in my bubblechart work as expected. Any idea how I can do a delay? Thanks! // ... Exits existing data elements with data, transfer 0-radius to Gdata Join.ext (). Select all ("text"). Transcision () Delay (1) .remove (); Select gDataJoin.exit () all ("Circle"). Transcision () Duration (transit time) .attr ("r", 0); GDataJoin.exit (). Infection (). Delay (transition time) .remove (); delay (1) is same delay This is working 1 milliseconds - for milliseconds. Change to: gDataJoin.exit (). All ("text"). Delay (1000). Deletion (); GDataJoin.exit () Select all ("circle"). Transcision () Duration (transit time) .attr ("r", 0); GDataJoin.exit (). Infection (). De

segmentation fault while importing nltk in python -

I'm having a partition fault while trying to import nltk on a Debian machine Python Verbose output is given here: - & gt; & Gt; & Gt; Import nltk .... .... import scipy.linalg.blas # /usr/local/lib/python2.7dist-packages/scipy/linalg/blas.pyc# trying / usr / local / lib / First precompiled python2.7 / dist-packages / scipy / linalg / _fblas.so dlopen ("/ usr / local / lib / python2.7 / dist-packages / scipy / linalg / _fblas.so", 2); Partition fault any suggestions? I have tried to uninstall and tried to restore it by the SSPP. Thank you, Amit I had the same problem. I have uninstalled SIPP and nltk, then only have to reinstall nltk. workspip uninstall scipy pip uninstall nltk pip install --no-cache-dir nltk python import nltk nltk.download () works However, the problem came back when I reinstalled Sipi ... The solution for me was to uninstall both the packages using PIP and Kando (Konda Anant NLTK), then using PIP using KNDO and NLTK

Assign Max() MySQL command to a variable in PHP -

In my mysql database, I enter an entry in DB, and then I need to get the number of that last entry. I have set it on auto-pay increment Question "Use Select from the table" (id); Works fine in the database, I need to capture that number into a variable in PHP. $ rowSQL = mysqli_query ($ con, "MAX (ID) from selection table"); $ Line = mysqli_fetch_assoc ($ line sql); $ Largest uid = $ line ['max']; Counterpart $ largest UID; Thanks for the help! AS in your query modifier this modifier nicknamed your selected item $ rowSQL = mysqli_query ($ con, "select MAX (ID) table from AS max"); $ Line = mysqli_fetch_assoc ($ line sql); $ Largest UID = $ line ['maxid']; Counterpart $ largest UID;

css - Changing font color without using color style -

I am currently using a content management system that automatically style = "color: white;" Inline CSS, but I have to change the font color of a certain element to white. Is there any such move that I can use it which can show the font in white form without using color: white ? (Note that white could be #fff here, RGB (0,0,0) ect) Note: I can not define a CSS class because & Lt; style & gt; Tags are completely removed, and any inline color definition is "Color:;; I was hoping for a solution, where I want to show some such black color, in which some black Color looks, or something is difficult color: #ffffff; White hex, even if they check against that color: RGB (0, 0, 0); or RGBA (0,0,0,1); < / Code> or better yet Use of S squares: HTML > css white {color: #ffffff;}

erlang - How to work around limitation in io:setopts([{echo, false}]) with io:getline/1 -

I'm trying to put a password prompt in my app and io: get_line / 1 , The characters that write, they write stdout. After the documentation, I am trying to do io: setopts ([echo, wrong}] returns the returns {error, enotsup} and do not start echoing successfully. I open / dev / stdin and / dev / stdout directly because it is not a multi-platform Any recommendations for working around the range of echo with Io: setopts code>, or what I'm trying to do Find an alternative way to complete Unfortunately, there is currently no easy way to do this. Older versions of scripts Io server Do not use either io: setopts ([[resonant, false]]) neither io: get_password () work with ascript. The best solution for reading the passwords is: read-password ./script $ password where ASScript is something like this: #! / Usr / bin / env escript main ([password]) - & gt; Io: Format ("-> ~ p \ n", [password]).

loops - Pointing to specific line in program with if statement? Java -

I have a program that tells the user to input values ​​between 1 and 6. However, if they do not ask in the middle of that category, I want to ask the user again for input to the program. I have other code inside the method, so I can not just point out the method System.out.print ("Now enter the number between 1 and 6"); DieNumber = keyboard.nextInt (); If (death == 1) {doon (pane); } And if (dieember == 2) {drawTwo (pane); } And if (Maranambar == 3) {W. Darren (pane)}} and if (dieember == 4) {drawing (panels); } And if (dieember == 5) {drawing (panels); } And if (dieember == 6) {drops (panels); } ask each user again when entering a number Loop is required for System.out.print ("Now enter a number between 1 and 6"); DieNumber = keyboard.nextInt (); While (Maranambar> 6) {System.out.print ("Now enter a number between 1 and 6"); DieNumber = keyboard.nextInt (); } If (Maranambar == 1) {doon (panels); } And if (dieember == 2) {drawTwo (pan

ada - Storage_Error on array declaration -

I have a problem with the function written in ADA 95. When the function is called, then before I perform the first statement, Storage_Error (which is a log message). By commenting on announcements and tests, I have reduced the problem from the line below: Field_Values: Message_Field_Array; The relevant type definition for Message_Field_Array is as follows: Type Extract_Field_Type Record field: string (1. Comms.Buffer_Type'Size): = (Other = & gt; ''); Charcoa: Integer: = 0; End record; Type Message_Field (Message, DATETIME, EPOCH, GPS_CLASS, OBJECT_NAME, Train, Lat, LNG); Type Message_Field_Array is the array of Extract_Field_Type (Message_Field'Range); I have clearly remembered something what I have set up here in what is wrong? Your sources are incomplete, but I guess your error is 'size Is to use, where you mean 'length .

mongodb - Best way to return documents that include a count of an internal collection? -

I have a collection with documents, such as the following: {title: First, "Everything": ['Something', 'Something']} And I would like to get output like the following: {"First", 3}, {"seconds, 2} What's the best way to do this? I call it the map function Implemented by: db.coll.find (). Map (function) {return {title: Item.title, count: item.sub_items.length};}) ; When trying to get the above results, would I be better to use and use something to be better than a display perspective if you have MongoDB 2.6 or later < / Strong>, you can or $ size from the document: count The power and the total number of items in the array. Below is an unwanted example: db.coll.aggregate ({{"$ project": {"Title": 1, "count": {"$ size": "$ sub_items"}}}))

C basics: comparing "*char" and "char[x]" for string creation -

Image
A very basic question Why does the following two orders result in the creation of two different sized stars? As you can see below, method 1 creates a string with size 8 bytes and method 2 creates a string with size 5 bytes. Why the method 1 is causing the confusion as to the size of the 8 bytes ... (I've already seen these posts: and as long as I Reading-understanding-does not fail, it does not really know why the method makes a string of 1 size 8 bytes ... According to the reactions, it appears that method 1 should be made an indicator of size 4 bytes. ) Method 1: char * string = "ABCD"; Method 2: Four string 2 [5] = "ABCD"; For example, when I run the following program, I get the output shown below. #include & lt; Stdio.h & gt; Int main (int argc, char * argv []) {char * string = "ABCD"; Printf ("String size:% ld \ n", sizeof (string)); Printf ("the size of each element of the string"; \ "AR

c++ - Generate mouse events using Qt framework -

I am using the QT framework and I would like to generate mouse events outside of my application window. So far I have been able to use the mouse pointer to use them: QGuiApplication :: Override Cursor () - & gt; Setpos (X, Y); How do I click the left mouse button, click the middle button, click on the right button and mouse wheel movement? A few years ago I wrote a driver for GUI testing (mouse and keyboard). Drivers have been developed for Windows, Linux and Mac OS X. You can see there is an OS dependent mouse driver implementation for Windows. In addition you can see other implementations. This is an open source project, you can use it for free code.

eclipse - How to create a custom toggle button with an image on it that also scales correctly for each density in android -

Here's what I'm trying to do: Create a toggle button. The background color of the toggle button when one stops, then there will be a color. The toggle button should have an image focus which is centered on everything. The toggle button may be in 3 states, on, off, on, on, running, in which each case has more sensitivity for example and I can show how something in the button I have been dialed for MDPI at exactly the button dimension diode and it is scaled for all the other density. I want that the image be focused to stretch the image using the appropriate density image of the center. What would be the most obvious approach to all this, at least what would be the most favorable for the number of headaches and equipment? Is the whole button making background an image best? For a state and for each one density, using a button for shutting down and overlaying the image, there should be a better way on it and control the background color property for the on / of

How do I make a node.js TCP connection reconnect automatically? -

I wrote a TCP client and server in node.js. I can not understand that the way to reconnect the client is disconnected for any reason. I understand that I have to handle the 'closed' event, but it is an incident that only gets removed when the connection is closed gracefully here So far the code I have made is: function connect () {client = new net. Socket (); Client.connect (config.port, config.host, function () {console.log ('connect to server');}); Client.on ('close', function () {console.log ('linked to server') '; connect ();}); client.on ('error', ...); // What do I do with this? Client.on ('timeout', ...); // What is this event? I do not understand} Can anyone explain what I can do in the error and timeout ? And how do I know that the network has disconnected and reconnected? You may only see error event handler for no-op / blank function In the form, even after error , close event for TCP sockets is

bash - vim and sed single liner: negate search, multiple search the substituted line, open file and highlight in vim editor -

What I want to do in a row is the following: 1. Search file for lines that do not match a pattern In ak.txt, each line is set to \ & lt; Matches the negation \ & gt; \ | : $ sed -n '/.*[-9] [0-9] \ [0-9] [0-9] \ [0-9] [0-9] [0-9] $ / s: *: ... \\\ & LT; & Amp; \\\ & gt; \\\ |: p 'ak.txt Output: \ & lt; Ee integration_01.32.00 \ & gt; \ | \ & LT; Ration_01.2.000 \ & gt; \ | \ & LT; Gon_1.21.000 \ & gt; \ | \ & LT; Dkei_ting-on_1.2.00 \ & gt; \ | \ & Lt; See Integration Instructions & gt; \ | Works upwards, I do not want the last two letters on the previous line ... ... 2. Illuminate the substitute line searches for inquiries from 'VIM', error The command is thrown down: $ vim -c "/` sed -n '/.* [0-9] [0- 9] \ [0-9] [0- 9] \ [0- 9] [0- 9] [0-9] $ /! S: * *: \\\ & lt; & amp; \\\ & gt; \\\ |: p 'ak .txt` "-C 'set hls' ak.txt Error: bash :. Unknown hist

sql - why results of two queries are different? -

Select a different ID, the title, taking the curese_id into the course, takes you to the course. Where corsse_id = takes.course_id .course_id in (takes corsse_id from selection, where id = '10204'); Select ID, title, takes corsse_id course course is included in course.course_id = takes.course_id where id = '10204'; I want to ask the course ID and the title of those courses, whose students take the ID of 10204 first gives a result with 5000 rows which is wrong. The second one give the right results. So what's wrong in the first? In the first query, data is given to all students who take a course that is 10204 Takes. / P>

scripting - Appending multiple entries to an output file with a crontab using php? -

I am writing a script in PHP where I log in system uptime, current time and the quantity of users in a log file system These have been done, and are continuously updated through a crontab. I need help for this, that I would like to submit the updates in the file and will be continuously added. Until now, whenever my script is executed, the latest update overwrites the previous update. What I have done is that I tried to declare an array of entries and as I repeat through the array again, press the contents of the update in the array (this half-baked There may be a bit of logic in my part). My code: $ fileName = '../so-and-so directory / output.log'; $ Dt = date ('m / d / y'); $ Time = date ('h: ii'); $ Data = shell_xax ('uptime'); $ Uptime = explosion ('up', $ data); $ Uptime = Explosion (',', $ uptime [1]); $ Uptime = $ uptime [0] ','. $ Uptime [1]; $ User = system ('w', $); $ Array = new splfixedArray (3); $

html - jQuery Drag & Drop without Destroying dragged item -

I have some difficulty with the following and how it can be obtained (bus) requires some guidance . Using jQuery, how can I drag an object into a container, register it for events, and leave the original drawn item in place. It is very difficult to explain, can have a site with a work example: I am familiar with using dragable, and droppable, and an original Entering the container, although on the drop, the dragged object has been taken from its original location. Actually, I want to get it & gt; There is not a list of images that are registered with dragable. Place a container that has been registered as a Droppad Detects any of the images in the container on the drag and drop action, collision, and some HTML render (For demonstration purposes, you can show how to do it with any image, and there may be a link on the dropped result page. During this process, the image is not protected Should not be removed from the list. Eve Register target HTML with ents (for

java - How do I get this try catch to loop until it no longer gets an error? -

I have a try block that is checking whether the input is from the scanner or not. But instead of loop it twice and asks how many people have to send .. Then say error: no number. Actually without prompting the user to enter a different number int peopleToSend = 0; // I tried to catch one ... but it is not working for whom I was planning for ... while (locosed & lt; 1 || people suspect & gt; people olive ()) {try { system.out.print ("\" How many people do you want to send out? 1 - "+ PeopleAlive () +": "); PeopleToSend = scan.nextInt (); } Hold (exception e) {System.out.println ("Error: no number."); }} An example of output when entering someone other than an int. How many people do you want to send? 1 - 22: Error: No number How many people do you want to send out? 1 - 22: Error: No number How many people do you want to send out? 1 - 22: Error: No number How many people do you want to send out? 1 - 22: Error: No number * Loops fore

javascript - Code Does Not Work WIth at the top -

I have & lt ;! DOCTYPE html & gt; What's more at the top of my page is that the user allows to click anywhere on the page, and then redirects to another URL. This works when I & lt ;! DOCTYPE html , but I keep it in the page Here is the code: & Lt; Title & gt; Untitled document & lt; / Title & gt; & Lt; Style & gt; the body. Center page {cursor: hand; } & Lt; / Style & gt; & Lt; Script & gt; Function goto () {location.href = "http://www.google.com"} & lt; / Script & gt; & Lt; / Head & gt; & Lt; Body class = "enterPage" onclick = "goto ();" & Gt; Your content & lt; / Body & gt; & Lt; / Html & gt; Why does this happen? @Pointy appreciate comments, in addition, make the following changes to your CSS: & lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" cont

Creating readonly views in Sql Server -

According to MSDN, the selection of easy-made ideas automatically allows you to use the insert / update / delete statement on the table. Is there any way to stop it - to tell the SQL server that the view is read-only, and you can not use it to modify the table? The best way to delete UPDATE / DELETE / INSERT permissions on the view In addition to this you can create a INSTEAD OF , triggered on this view that there is nothing to silently update or to exist there. You can choose one which does not change in semantics or efficiency and then violates it. Edit: Below is billed accordingly. <100> x >

java ee - Store JBoss (Wildfly) logs on database -

Is there no way to store jebaus logs in Hbbase, Infinine or elastic search? Or, is it to create a new log handler in my application to store data in the database (this is not the new Jbus module because I want to use the CDI). No, I do not know custom log handlers are created as modules and do not load from the application Can be done because the applications are not yet loading when the logging subsystem starts. Here's how to create a custom log handler: Why is the need to use BTW cds? And if dependency injections are important to you, then you can be sure that the F.I. Can also be used. Guice

c++ - how can I make a mex function printf while it's running? -

There is a max file in my MATLAB script, it may take a while to run Max Function, so my code is "without To prevent "any remaining output", I put too many printf statements in the Max file, which produces some running information about the data being processed. But when I call the Max function, it does not do anything like printf and it remains there while the int is running. Finally, after the completion of your work, this printf all the info I would like - it's not going to be, but after finishing This is not what I need. So I want to know how to not only make it printf , but whenever I want it printf it. Yes, mexPrintf is what you need but note that the command window The buffer does not flush with force to use it, often it's too late before your message is printed. This happens if you start heavy computation after calling mexPrintf . After each call for mexEvalString ("outow;") mexPrintf If you think that unappea

asp.net mvc - MVC - Sending List of Values to AJAX call -

I have a model that opens & amp; The user gives the option to check some checkboxes when the user checks the check box of their choice I want to send all the values ​​of the checkbox & amp; Call AJAX method. I want to send the value of the selected checkbox to the controller method. This is my code: - // These are dynamic checkboxes - this is just an example & lt; Input type = "checkbox" name = "name" value = "code" & gt; & Lt; Input type = "checkbox" name = "name" value = "code1" & gt; & Lt; Input type = "checkbox" name = "name" value = "code2" & gt; & Lt; Input type = "checkbox" name = "name" value = "code3" & gt; // onClick event button jq.get ('/ controller / gate data', function (data) {jq ('# placeholder'). Html (data);}); // Controller [HTPGet] Public Action Result Milladata () {partial view (&q

jquery - How to retrieve first value from Array objects into a new Array in Javascript? -

मेरे पास वस्तुओं का एक जावास्क्रिप्ट अर्रे है जैसा var डेटा = [{id: 1, तिथि: '1/1/2011', टूडू: 'गणित'}, {आईडी: 2, तिथि: '1/1/2012', टूडू: 'साइंस'} .......... ....... और सुओ ऑन]; मुझे परिणामस्वरूप डेटा चाहिए var newArray = [['1/1/2011', '1/1/2012'], [ {आईडी: 1, टूडो: 'गणित'}, {id: 2, todo: 'science'}] ] मैं यह कैसे जावास्क्रिप्ट में कर सकता हूँ कुशलता से? फ़ंक्शन तैयार (डेटा) {var परिणाम = [[], []] ; के लिए (var i = 0; i & lt; data.length; i ++) {परिणाम [0] [i] = डेटा [i] .date; परिणाम [1] [i] = {आईडी: डेटा [i] .id, todo: डेटा [i] .todo}; } वापसी परिणाम; } var newArray = तैयार (डेटा);

python - what kind of epoch time is this -

I have an era's time value: 1412835422648 when I By converting python using this date and time, I get a strange date, it is done as follows: & gt; & Gt; & Gt; Import time & gt; & Gt; & Gt; Time.strftime ('% Y-% m-% d% H:% M:% S', time.Locetime (1412835422648)) '46740-12-22 07:04:08' What type of era is that? How can I get my local system time in a similar format using Python? has been in Timestamp millisecond from the time of the era, it probably came from Java That is where this type of timestamp is standard. To make it usable with time.localtime () , to convert it into seconds, divide by 1000: In [2]: time.strftime ('% Y-% m-% d% H:% M:% S', time.Locetime (1412835422648/1000)) [2]: '2014-10-09 07:17 : 02 ' To get time in this format, use time.time () , multiply by 1000 as result and round in round: / p> in [4]: ​​int (time.time () * 1000 + 0.5) out [4]: ​​1412836344862L

Set Timeout for MAX_AGI_CONNECT in Asterisk -

I have an Estheris installed and there is a zooper softphone whenever we call, there is an error displayed on the star sign : Warning [28761]: res_agi.c: 1498 Launch_netscript: 'AG: //0.0.0.0 / Fastagi connection Agi' MAX_AGI_CONNECT (2000) time expired after milliseconds - Auto Folthru, the channel 'SIP / 123 -0000003D' status is 'unknown' It takes about 10 seconds to connect to the call But time-Out 2 seconds, the call is never connected. My question is how can we change the default time-out from 2000ms to 15000ms? The problem is that at some point in your dialplan there is an AGI that can not be executed. exten => ????, n, AGI (agi: //0.0.0.0/incoming.agi) If you need this, you need to get a connection in the right way or in a change Your script has to fix Dialplan If you really need this, you can

ruby - Mongoid 'or' and 'in' - querying multiple arrays -

I have a document in Mongo with two array areas: field: ap_uussernem , Type: array field: email_resource, type: array I want to create a function that takes an array of user names and an array of email addresses to search the archive. The kicker is that I want it to return those documents which any def find_people (usernames_to_search, emails_to_search) ... given values ​​in arrays. A document is given with field values: ap_jolation name = ['test1', 'test2', 'test3'] email_andres = ['Test1 @ test com', 'test2@test.com'] I think the function is to find it when those values ​​are searched, array parameters I through. This document should be returned in the following cases: search_people, ['test1@test.com'] search_folk ['test3'], ['test1@test.com' ] Search_folk ['old name'], ['test1@test.com'] The last one is bothering me. So far I have tried . Or (: app_usernames.in usernames

bash - Why is a file tested with -r not readable by cat? -

In this I have a cron job with two lines: LOCK = / var / run / dns-check ... if [! -r "$ LOCK" - "$ ADDR_NOW"! = "$ (Cat $ LOCK)"]; Then This is the only use of cat in the script. Today I received the following error from the cron: cat: / var / run / Dns-check: there is no such file or directory I wonder what's happened here. I am checking the file with -r so that it is legible and not the result. This means that if the file is not readable, the check is successful. Evaluation can stop here because the expression is already true. cat will not be called. Otherwise, the -o status is evaluated, which means if the file is executed, cat is executed. Why the cat reports the error, that the file can not be read, although test -r is detected that it is readable? Using conditional form does not evaluate the short circuit instead, instead, try: [! -r "$ LOCK"] || ["$ ADDR_NOW"! = "$ (Cat $ logica

javascript - Angular ui-routing and multiple views in nested child states -

I have an original condition that is abstract, which is basically only the template HTML which contains Yuri-Vision and I have more than one Child states are in which many ideas are included, and in every state of the state there are child states which include many scenes including the first child state in the line I work fine, but when I try to reach the state of child state of the child So it gets crashed Is there. Here some code is simplified (in my actual code there are many components on the page. It acts like a tud. It is basically a list and an edit scene (I list in the row / Line editing) and editing view will show you the same item, or hide / hide the new item or create new item. I still want to show remaining lists for other components): < P> index.html: & lt; Div ui-view & gt; & Lt; / Div & gt; & Lt; Div ui-view = "todo-edit" & gt; & Lt; / Div & gt; & Lt; Div ui-view = "todo-list" & gt; & Lt; / D