Posts

Showing posts from May, 2010

curve fitting - Find values of constants in equation using MATLAB -

मेरे पास समीकरण F (f) = a * f ^ 3 + b * f + c । मुझे डेटा के वैक्टर, पी , स्वतंत्र चर, 'एफ' पता है मुझे a , b , c के मूल्यों को खोजने की आवश्यकता है I क्या मैंने कोशिश की: function [val] = myfunc (par_fit, f, p)% यह मुझे a, b, c% p = af ^ 3 + bf + c val = norm देता है पी - (पैरा_टेट (1) * (एफ। 3)) + (पैरा_टिफट (2) * एफ) + (पर्स_टिफेट (3))); अंत my_par = fminsearch (@ (par_fit) myfunc (par_fit, f, p), रैंड (1,3)); यह मुझे my_par = [1.9808 -2.2170 -24.8039] देता है, या a = 1.9808 , b = -2.2170 , और सी = -24.8039 , लेकिन मुझे लगता है कि b 5 से बड़ा होना चाहिए, और c शून्य से बड़ा होना चाहिए । मुझे लगता है कि आपकी समस्या हो सकती है क्योंकि आपका उद्देश्य कार्य गलत है: val = norm (p - (par_fit (1) * (f। ^ 3)) + (पैरा_टिफट (2) * f) + (पैरा_टिफ (3))); शायद होना चाहिए: val = norm (p- (par_fit (1) * f। ^ 3 + par_fit (2) * f + par_fit (3))); लेकिन जब आप fminsearch के बजाय fmincon का उपयोग कर कम से कम करते हैं, तो आप चर के मूल्यों को सीमित कर स

mysql - Cannot process using parameterized inserting -

I get an exception, the column can not be empty, my database was not saved. Save the private sub save_lick (System.EventArgs as the Sub-sender object, ByVal E as the system) Handle. Click con.close () con.open () CMD = New Odbc.OdbcCommand ("INSERT DB .table (first name, last name) value (@ F1, @ F2) CMD parameter.advate value (" @ F1 ", Text Box First Name Text) CMD Parameter Advant Value (" @ F2 ", Text Box Name Text) CMD .xecuteNonQuery () End Sub But if I will do my work of this code saves the private sub handle_lick (ByVal Sender System.Object, ByVal e as System.EventArgs) handles. Click co D.v. End Sub

debugging - Find bug in the C Program to Reverse a String -

I have written the following code to reverse the string. But this is giving some error to reverseStr () < / Code> The function is trapped after calling. I'm unable to find the bug. Can someone help me? #include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; Four * reversal (four * str) {int i, len = 0; While (str [len]! = NULL) {len ++; } LAN- = 1; Four floating; (// printf ("% d% d% s \ n", i, len, str); temp = str [len-i] for (i = 0; i & lt; len / 2; i ++) ; Str [lane-i] = str [i]; str [i] = floating; // printf ("% d% d% s \ n", i, lane, str);} return str;} int main Zero) {char * str = "abcdefg"; Printf ("original ::% s \ n", str); str = reversestroke (str); printf ("reverse:% s", str); return 0;} As suggested by P0W, if you change from str * str [] then this work There is no need to return any strings because you are going through this context, so changes will be made on this. The code b

javascript - Multiple flashing text items using 1 id? -

I have a problem with javascript and html this is my script & lt; Script type = "text / javascript" & gt; Function FlashText (instant, call) {var tmpColCheck = document.getElementById ('Instant'). Style.color; If (tmpColCheck === 'silver') {document.getElementById ('immediate'). Style.color = col; } And {document.getElementById ('immediate'). Style.color = 'silver'; }} SetInterval (function () {flashtext ('flashingtext', 'red');}, 500); // To repeat the function, an interval timer set and here is my html, The ID is immediate, which is called backend settings, it's the only one that I want to flash / blink. Here's the problem, it works = Deyy! ... but only all the other immediate examples on the first example are concrete. So what I see is that how can I flash / blink all the examples and not just the first example? Thank you :) I run my code and if you are continuous It works

javascript - How to apply class to the active tab page from chrome extension -

I'm developing in which a popup can choose a color scheme from the list given in the popup and open it in the Highlight tab. From one of the code snippets, I know that the background color changes by using code: "document.body.style.backgroundColor = 'red'" . What are my steps Select the color scheme from the popup <00> < / Li> popup.js Document.addEventListener ('DOMContentLoaded', function () {var li = document.querySelectorAll ('li'); for (var i = 0; i & lt; li .length; i ++) {li [i]. AddEventListener ('click', click;)}}); Function click (e) {// console.log (e.target.className); // gives the correct value chrome.tabs.executeScript (null, {code: "var scriptOptions = {param1: e.target.className};}}, function (e) {console.log ('clicked class') ; Console information (absolute 1); // does not say anything document.body.setAttribute ('class', e.target.className);}); window.close ();

Sequelize.js how to show error on create when using the .on("error") syntax? -

I am trying to explain how to pass the client due to the failure of creation. I am using the recommended status code and I want to add details to the X-ray-ridge header. But when I use the "(") syntax, how do I pass the fault object in the callback function thanks player.create ({name: Req.body.name, fname: req.body.fname, email: req.body.email,}). Console log ('player creation worked!'))) .on ('error', function (player1) {'success', function (player1) {res.status (201) .jsonp (player1) Res.header ("X-status-reason:", "Where's my err.description?"); Res.status (400) .jsonp (player1); console.log ('an error in player creation')}) First error error codeback should be error , Player1 )

c# - Split list<t> into files by n number -

I have a list that contains more than 4000 items. These items are passed through a method which Returns the XML block as a string. I would then need to use the sticker to write these strings in the XML file. There is a limit of 1000 "string" permissions per file only. int elementCount = 0; Int filename = 1; String filename = "c: \\ test \\" + date time.Now (). ToString ("ddMMyyyy") + "_0" + File Number + ".xml"; What {StreamWriter sw = new streamer (filename); Foreach (in vehicles in vehicles) {if (elementCount! = 1000) {sw.WriteLine (ConvertCode.Toxml (v)); ElementCount ++; } Else {sw.Close (); FileNumber ++; Sw = new streamer (filename); ElementCount = 0; Sw.WriteLine (ConvertCode.ToXml (v)); ElementCount ++; break; }}} At the end of this code, I expect that there should be 5 files with 1000 items and 1 other file with the remaining balance of the item (elementCount & lt; 1000) 4 files with In those moments, I'm gett

apache - Can I test a website locally through iOS? -

This is a very specific question. I really hope you guys can help me I am making a website (duh), but I always keep on traveling. I am having problems with web hosting companies, so I decided to make my website locally. As I have said before, I am always on my iPad, so, I can not always work on my site, because I use XMPP to test my website. All my files are in Dopbox, I have written some XMPP files again, so that when I test them on a computer, it receives files from dropboxes as it is on dropboxes, can I Am I able to test my site on iOS device (and hopefully MySQL database with Apache?) Is there any other solution? (Note: I am not interested in buying anything like Surface Pro) I got it! Codeanywhere gives me the functionality to edit my site on my phone, and test it (using my device 'DevBox')! I still need the internet and my files are no longer in Dropbox, but ok, does this work right? Hope this helps someone ...

jquery - Issue with window.height and width in localhost and server -

I have used the following function to see the height and width of my webstream. function showViewPortSize {display} {var height = jQuery (window) .height (); Var width = jQuery (window). With (); JQuery ('body'). Prepaid ('& lt; div id = "viewportsize" style = "z-index: 99 99; position: fixed; top: 40px; left: 5px; color: # 000; background: #fff; padding: 10px" Gt; height: '+ height +' width: '+ width +' ;); JQuery (window) Resize (function () {height = jQuery (window) .Hight (); width = jQuery (window) .width (); jQuery ('# viewportsize') .HTML ('height:' + height + '& lt; br & Gt; width: '+ width];}); }} ShowViewPortSize (true); But the value in the local host and server is different. Why this difference?

What alternatives have sockets programming tcp on c++ linux -

Is it possible to program the network client and server, just open the Linux C ++ using system functions, read And write? Are low-level options chairs? Thank you. You need more than all those three. You socket , bind , listen to , connect accept , And generally use select , poll or platform specific / higher performance modern Apollo (Linux) and kqueue (BSD) Depending on the type of socket, you can recover with read and write , but you can only read "and The only way to use "write" is to have an embedded super server Can open the network port. Map your port for STDIN and STDOUT and see Inetd if this is your purpose if you go that route, you do not need to read and write You can actually use printf . A program under Inetd should also know that it is a network program. Why not try a high level library? Check Boost. Aco

java - .htaccess and SocketException: Connection reset, SocketException: Broken pipe -

Is there a connection between firewalling .htaccess and SocketException? Suppose that host.are.everywhere.in.the.net was denied in .htaccess what would happen if I'm from that hosted host ... I will get socket expiry: connection reset, socket extension: Send the broken pipes and some information while making the socket? Or are not associated with bounds in erros .htaccess? Or what are these errors in common case? The restriction in .htaccess usually only affects the data sent by the server, meaning that the server can send an HTML page with an error code 403 and some error messages. However, all are part of the HTTP protocol, and this requires a working TCP connection. The server can close the connection after the response, even if the customer wants a constant connection. In short: Any restrictions in .htaccess should not be the reason for the problems you are told.

playframework - [Solved:]How to run play commands? I am getting the error "play FAIL formats: can't open input file" -

I downloaded the zip file of Play2.2.1. After this, I pulled it out and tried to play the executable, but it says, "Make 2.2.1 with Scala 2.10.2 (Java 1.8.0_20 running), There is no play application! Use New to create a new play app in the current directory, or go to an existing application and click play Launch the Development Console by using You can also browse the full document " I tried the command by giving my own home directory (Play2.2.1 in play is executable) to play the executable (./download / play -2.2.1 / new Play the map) and created a new app. But any play order like play ~ run etc ... are not working, I think this issue was related to some issues issues. But I do not know how to solve it. Can anyone help me with this? Thanks in advance . * You can create a nickname for game binary by adding on NIX platforms alias play = "~ / Downloads / play-2.2.1 / play" your .bashrc (or .zshrc If you are using zsh) After this you ca

java - log4j:WARN No appenders could be found for logger. Log4j 1.2.17 jar -

Image
i is getting this error log4j: warning not found appenders to be found for logger (Com.company.Main). Log4j: Start the Warning Log4j system properly. Log4j: See Warning http://logging.apache.org/log4j/1.2/faq.html#noconfig For more information This is my main < Code> package com.company; Import org.apache.log4j.Logger; Public Class Main {Last Stable Logger Logger = Logger Tag (main square); Public static zero main (string [] args) {If logger error is enabled () (logger. Debug ("this is debug"); // logs an error message with parameter logger. Although this is my log.properties file # root logger option log4j.rootLogger = debug, stdout, file # Redirection log messages log4j.appender.stdout = org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target = System.out log4j.appender.stdout.layout = org.apache.log4j.PatternLayout log4j.appender.stdout Layout.ConversionPat Tern =% D {yyyy-MM-dd HH: mm: ss}% -5p% c {1}:% L -% m% n # Redirect log messages to log

c# - Could not load file or assembly 'Microsoft.SqlServer.DTSRuntimeWrap -

I have created an SSIS package which will export the data to MSACS. If I try to run the package on its solution project it will execute without error. But when I say package within your program, I get an error The file could not load assembly Microsoft.SqlServer.DTSRuntimeWrap, Version = 10.0.0.0, Culture = neutral, PublicKeyToken = 89845dcd8080cc91 ' This assembly was compiled for a different processor Here's my code:. Public Zero RunPackage () {textstring ("Launching package ..."); M_worker2.ReportProgress (20); String PkgLocation; Package PKG; Microsoft.SqlServer.Dts.Runtime.Application _app = New Microsoft.SqlServer.Dts.Runtime.Application (); - & gt; I've got an exception. DTSExecResult pkgResult; PkgLocation = Properties.Settings.Default.PackageLoc + "\" Package1.dtsx "; textstring (" Loading package ... "); m_worker2.ReportProgress (30); pkg = _app.LoadPackage (PkgLocation, null); textstring ( "package execute

java - How to find specific path patterns efficiently? -

Image
Searching for a specific path on the grid is to find a pattern similar to the 2D grid of simple nodes: < / P> Public category tIllnode {Private Final IND; Public tile node leftNeighbour; Public TileNode Top Now; Public tile node right; Public tile node below; Private Tilestate OnTelGameState; } If a neighbor is not able to cross the current node then this state is set to outOfGame . I tried with the recursive DFS Algig to find all the paths but the complexity was terrible. I will try to search the path to search with those paths: < / P> The red nodes are those where we start and end, the black lines are the paths, which should go to other nodes (neighbors), who are capable of passing. We do not consider any other path other than those specified and certainly there is no limit to the length of those paths. Edit: I would like to check that there is a way between two nodes that will follow the path on the image. It can be very simple that more than one of the

plsql - oracle dbms_scheduler repeat_interval -

I have a process named MY_PROCEDURE_X in a packaged MY_PACKAGE_X. My requirement is that there is a need to execute on the first and the 16th of every month. If it is running on the first part of the month, the execution time should be at 10:00, if it is going on the 16th day of the month, the execution time should be at 05:00. Can I do a single job for both of these? Below is my half-script: dbms_scheduler.create_job start (job_name = & gt; 'PROCESS_MY_JOB_X', JOB_TYPE = & gt; 'PLSQL_BLOCK', JOB_ACTION = & gt; 'MY_PACKAGE_X.MY_PROCEDURE_X ', START_DATE = & gt; TO_DATE ('01 -11-2014 10:00', 'DD-MM-YYYY HH24: MI'), REPEAT_INTERVAL = & gt; 'freq = day; INTERVAL = 14', enable = Gt; correct, comment = & gt; leave 1 and 16th of each month '); End; Thanks in advance ;) < when P> edit: in my previous answer did not really work BYHOUR could not be used in time decide for some reason - it gave an

What is the fastest way to lookup a large number of values using R? -

I have a list of more than 1,000,000 numbers. I have a lookup table that has numbers and a range. For example, 0-200 Category A, 201-650 is Category B (ranges are not of the same length) I need to just recycle on the list of 1,000,000 numbers and get a list of 1,000,000 related Categories Edit: For example, there are some elements of my list - 100, 125.5, 807.5, 345.2, and it should return categories As for logging like some 1,1,8,4, logic has been implemented in a function - categoryLookup (CD) and I am using the following command to get categories Cats & lt; - sapply (List.cd, categoryLookup) However, as long as it works up to 10000 on the size lists, it is taking a lot of time for the complete list. What is the fastest way to do this? Is there any indexing that can help speed up the process? number: numbers < - Sample (1: 1000000) Groups: Groups & lt; - Sort (Representative (alphabet, 40000)) Lookup: Categories & lt; - Groups

css - Setting pseudo element background image using javascript -

Image
I have a div with the before selector I set the background of this div I add the CSS Blur filter to it. By using javascript I have to change the background image of this pseudo element dynamically. When I manually assign a position to the background, it works fine and I was able to set the image dynamically by adding style to the head tag, but the size of the image will not change, I get the image full of the viewport Width should be extended, but it is only displayed in its original size. Here is my CSS and Javascript CSS: .content-wrapper :: first {status: fix; Z-index: -1; Display area; Width: 100%; Height: 100%; / * Background: url (/landing/images/profile.jpg); * / Background size: Cover; Webkit-Filter: Blurred (25px) Brightness (.7); -Move-Filter: Blurred (25px) Brightness (.7); -o-filter: blurring (25px) brightness (.7); -M-filter: Blurring (25px) Brightness (.7); Filter: Blurring (25px) Brightness (.7); } Javascript: $ ('head'). Attachment ('& lt

java - Spring wsdl generation with jaxb:version="2.1" -

I am trying to generate a wsdl that contains a JSB binding version used in my XSD files. The end result is something of the range I wsdl want: : I use spring 2.5.6 with spring web service components 1.5.5. I suspect that the problem is in my Spring Reference Setup, which looks like this: & lt; Bean id = "Client services" category = "org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition" & gt; & Lt; Property Name = "PortTipName" value = "Client Services Port" / & gt; & Lt; Property Name = "locationUri" value = "http: // localhost / client / services / ClientServices" /> & Lt; Property Name = "Schema Collection" Riff = "Client Services Seema Collection" / & gt; & Lt; Property Name = "RequestShuffix" value = "Request Message" /> & Lt; Asset Name = "Feedback Sfix" Value = "Response Message" /> & Lt; /

php - Download Selenium Server -

Can someone help guide me, how can I download Selenium Web Driver? I have already installed the coding and are already testing approval in the php browser. I use it: https: // code Google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.35.0.jar You need Java, and what you run on the terminal < / P> Java -WhereSellonium file.or

scala - computing base class parameters from derived class -

I have the following problem (programming language: scala): A derived class D with base length The parameter should be calculated from its parameters: class D (A: IIT, B: IT) B (F (A, B)) {...} Now I have 3 possibilities: (A) Put the body of F (A, B) in the manufacturer of straight B: B ({...}) < (C) Define F as member function of D Which has to be stable (A) looks very strange, is this approach too legal? what will you do? I am asking the question because I am starting with Scala and have not actually been installed in our organization yet, so I can only use it at home. > Thanks for all the replies. Apply Apply method in the appropriate object to the constructor parameter in the companion object. Change from object B {def f (a: int) = a def apply (a: int, b: int) = new b (f (a), f (b) )} If you always need to change constructor arguments then think about the accuracy of your API. I think this code improves from code review.

c++ - Pointer dereferencing -

इस सवाल का पहले से ही एक उत्तर है: < / P> 1 उत्तर char * m_chString = "asd"; Cout & lt; & lt; m_chString; // प्रिंट एड्स कूट & lt; & lt; * m_chString; // एक पूर्णांक nValue = 7; Int * pnPtr = & amp; nValue; Cout & lt; & lt; * pnPtr; // प्रिंट 7 cout & lt; & lt; pnPtr; // nValue का पता प्रिंट करता है मैंने दो उदाहरण दिए, पहले स्ट्रिंग के पॉइंटर पॉइंट में, और दूसरे में, सूचक एक पूर्णांक मान को प्रिंट करता है। मेरा प्रश्न यह है कि, पहला उदाहरण से क्यों cout & lt; & lt; m_chString; मेरी स्ट्रिंग का पता प्रिंट नहीं करता है दूसरे उदाहरण में अगर मैं pnPtr प्रिंट होता / रही हूं? क्या pnPtr पते को इंगित नहीं करता? < P> इसका कारण यह है कि std :: cout एक चार * एक संकेतक के रूप में (पहला अक्षर) को सी शैली स्ट्रिंग का इलाज करेगा और इसे प्रिंट करें। आप इस पते को प्रिंट कर सकते हैं: - cout & lt; & lt; (शून्य *) m_chString; या यदि आप महान सी ++ प्रशंसक हैं तो cout & lt; & lt; Static

java - How to retrieve prefixed child elements using JDom -

I have the following XML snippet, from which I am trying to use the first element ZOOM, but I'm nullpointer I'm getting the exception. If someone knows, help me. & lt; Db1: Customer xmlns: db1 = "http://www.project1.com/db1" & gt; & Lt; DB1: CUSTOMERID & gt; 22 & lt; / DB1: CUSTOMERID & gt; & Lt; DB1: CUSTOMERNAME & gt; PRASAD44 & lt; / DB1: CUSTOMERNAME & gt; & Lt; DB1: Address & gt; Chennai & lt; / DB1: Address & gt; & Lt; DB1: Email & gt; Pkk@gmail.com< / DB1: Email & gt; & Lt; DB1: LASTUPDATE & gt; 2014-08-01T00: 00: 00 + 05: 30 & lt; / DB1: LASTUPDATE & gt; & Lt; DB1: nameDetail & gt; BSM_RESTeter & lt; / DB1: nameDetail & gt; & Lt; DB1: phoneBiz & gt; 99 16347 9 42 & lt; / DB1: phoneBiz & gt; & Lt; DB1: phoneHome & gt; 99 16347 9 42 & lt; / DB1: phoneHome & gt; & Lt; DB1: phoneMobile & gt; 944,990,031 & lt; / D

spring - Is java bean and java pojo same? -

इस सवाल का पहले से ही एक उत्तर है: < / P> 6 जवाब है जावा बीन और जावा POJO एक ही बात है या मतभेद हैं? सभी जावाबीएन पीओओओएस हैं लेकिन सभी पीओजेओ जावाबीन नहीं हैं जावाबीन एक जावा ऑब्जेक्ट है जो कुछ प्रोग्रामिंग कन्वेंशन्स को संतुष्ट करता है: जावाबीन क्लास को सीरियलजेट करने योग्य या एक्स्ट्रिबोरिज़ेबल को लागू करना चाहिए जावाबीन क्लास में कोई ना-आरजी कन्स्ट्रक्टर होना चाहिए - सभी जावाबीन गुण सार्वजनिक सेटर और गेटर विधियां (जैसा उपयुक्त हो) चाहिए - सभी जावा संस्करण उदाहरण चर निजी होना चाहिए

Basic Typescript, external define -

I have an object that is defined in an external JavaScript file CompanyName .TypeB some data = new date ('...') And to make things even more odd, the company name is also defined as one module from a typewriter file has gone. Module company name {} How do I use this JavaScript in type-scripts? I have tried and declared some combinations of modules, but the information I have been typed so far is not good enough thanks found it, courtesy module company name {announce {export class typeb} {static SomeData: Date; }}

swing - How to use the Timer class to set/reset a boolean periodically? (Java) -

I am trying to create a mole game. I have used swings to create a background and with event listeners The mole images that each time they click, the score increases, but the problem I have is that they do not want to appear or show. I thought the best way to do this would be to use the timer to set up / reset a boolean. This boolean can then be passed to the set of image (unsustainable) constructor, making random that period for which images are ideal to be visible. I have tried to start a timer and task (inhalation timer) class, call the timer. (VIS) which will have to reset the bootin and then the timer runs in the schedule (), but I am getting an empty pointer exception. Am I going wrong about this? OK, it will flip a bit with random intervals. After making some changes in the swingworker thread you can add the code to add the code. After changing it, depending on the value of the bit. import java.util.Timer; Import java.util.TimerTask; Import java.util.concurrent.atomic

jsf - <h:dataTable> not updating/refreshing after <f:ajax> has been performed -

Let me introduce my & lt; H: dataTable & gt; There are some problems with where I can not get it & lt; F: ajax & gt; Update / Refresh upon submitting the request, which resides within this table component & lt; F: ajax & gt; Listener Attribution & lt; H: dataTable & gt; on a specific line to be deleted Anybody please help me in helping it work. Code segment from my JSF page: & lt; H: dataTable id = "table1" & gt; & Lt; H: column & gt; & Lt; F: aspect names = "header" & gt; Object name: & lt; / F: facet & gt; & Lt; H: output text value = "# {object.name}" /> & Lt; / H: column & gt; & Lt; H: column & gt; & Lt; F: aspect names = "header" & gt; Action: & lt; / F: Aspect & gt; & Lt; H: form & gt; & Lt; H: command button value = "delete" & gt; & Lt; F: AJAX audience = "# {objectBean.delete (object.id

java - Queue an event before rendering a view in taskflow -

Image
I have a task flow with two views: listOfClients and newClient . As shown here: listofflict The view contains a table that I want to sort before sorting it. To do this, I would like to create a sort event with the table (as shown), but I can not reach the table before providing the view. I can not return the flow-scod managed bane but the findComponent table in the method queueSortIdEvent (return null ) Also try to see-scod, this result. My code in beans is: Public UIComponent findComponent (last string id) {FacesContext reference = FacesContext.getCurrentInstance (); UIViewRoot root = context.getViewRoot (); Final UIComponent [] found = new UIcomparent [1]; Route. Visititry (new full videoconnect (reference), new visitbackback () {@ override public visit visit visit (visit content context, UICmonant component) {if (component.getId (.) Equals (ID) {found [0] = component ; Return VisitResult.COMPLETE;} Visit Visitback.ACCEPT;}}); Returned [0]; } Public Zero Que

c - Lattices of Partial Order Set Segmentation Fault(core dumped) -

A set S = {x1, x2, x3, x4, x5, ....} whose size is n (& lt ; 20), I need a list of all the lattes (subsets of s) on the S with size (should be taken as input, but in my question I have fixed it for debugging purposes). The relation that has been defined in partial order is divisibility. #include & lt; Stdio.h & gt; # Include & lt; Stdbool.h & gt; Typedef Structure {int data; Structure node * next; } Node; Zero addEdge (node ​​* graph [], intestine one, int b) {node * ptr = (node ​​*) malloc (sizeof (node)); Ptr- & gt; Next = graph [a]; Ptr- & gt; Data = b; Graph [a] = ptr; } Zero BuildGraph (node ​​* graph [], int n) {int i, j; (I = 2; i & lt; = n; i ++) {for (j = 1; j & lt; = i / 2; j ++) {if (i% j == 0) {if (J! = 1) addEgege, I / J, I); And addEdge (graph, j, i); }}}} Zero print graph (node ​​* graph [], int n) {int i = 0; Node * ptr; For (i = 0; i & lt; = n; i ++) {ptr = graph [i]; Printf ("line-% d", i); While (ptr! = NULL) {

Select instance of model B in form where A has_one B and B belongs_to A in Ruby on Rails -

मेरे पास दो मॉडल हैं: class घर & lt; ActiveRecord :: बेस है_ऑन: श्रेणी के अंत वर्ग श्रेणी & lt; ActiveRecord :: बेस is_to: home end अब, मैं simple_form रत्न का उपयोग कर रहा हूँ जब मैं प्रपत्र में एक नया होम बनाऊँगा, तो मैं कई पूर्वनिर्धारित श्रेणियों में से एक को चुनने में सक्षम होना चाहता हूं (रेडियोबूटोन या ड्रॉपडाउन में) कोई भी विचार मैं साधारण मेल में कैसे काम कर सकता हूं?

rust - Check if a string is empty or blank -

what is the correct way to check whether a string is empty or not) & amp; Str b) string? I used to do it with "aaa" .len () == 0 , but do I want another way as my stomach? both and str and string is_empty ".is_empty (), true); assert_eq! (" ".to_string () .is_empty (), true); / Code>

CakePHP - Render views using elements vs ajax -

If views from different controllers use the same element, then different administrators can pass the same data Needed (so maybe doing the same processing) For ideas, would not it be better to call an administrator an AJAX call? Let's say that we have: Model / Post.php Model / User.php Model / service. Controller / UsersController.php Controller / ServicesController.php View / User / View.CIP View / Service / View.contact view / element / list_users_post.ctp A user is related to a service, and the user has many posts view / service / In view.cap , I want to display a list of each user of a particular service, and for each user, some related Infos and their 10 List of Ntim positions. In view / user / view.ctp , I want to display user related Infos and post 10 posts of it. Element view / element / list_users_post.ctp allows me to factorize the code displaying a user's table of positions. To set it, var needs to be of $ user.postList , and it should b

Python/PySide ImportError -

So I have recently started learning Python and Toolkit pyaside but I have a problem I could not find solution , Here is the error code: traceback (most recent call final): file "c: \ user \ column \ workspace \ application \ main.py", in line 1, ; Module & gt; From the Ui.window import window file, "C: \ user \ column \ workspace \ application \ UI \ window.py", line 4, & lt; Module & gt; From the Ui.menubar import menu bar file "C: \ user \ column \ workspace \ application \ UI \ menubar \", line 3, in & lt; Module & gt; Ui.window import from window import Err: name 'window' can not import and here is the code: main.py: < Import> PySide.QtCore import from the window.System import from Python. * From Import UI.window window from window = window () wind.Create () QtGui import * ui.menubar import menuBar square window: title = "callum" minWidth = 980 minHeight = 640 app = any win = any def (self):

android - Get width of CardView in Adapter.onBindViewHolder -

I have a list of posts and most of them are pictures (just post it like a G + or FB app) . Each post entry has an image aspect ratio, so I can set the height of the image according to the width of it, before the image is loaded even before the server, so the card layout will not change on load. Set the problem layout_width = "match_parent" for both card and post image. When I get the width of the cardview then it is zero. So I can not calculate the height Now I see that the only solution takes the width of the original container and reduces all the feet, but it does not look like a good solution. Is there any other way to do this? The adapter code is an example of @Override public void onBindViewHolder (ViewHolder holder, int position) {.... int width = holder.itemView.getWidth ( ); layout (irrelevant part) & Lt; / RelativeLayout & gt; & Lt; /android.support.v7.widget.CardView> Included in the post: & lt ;? Xml version = "

java - NavigationDrawer Fragment Styling/Icon -

I have tried some other stack overflow and Google-solution, but they did not work (,) I want to make the navigation drawer style but I do not know, which code should I change active object pressed / centered item / ul> And I want to add an icon before the list item too! Here is the activity where the content is loaded and the drawer is shown: activity_main_window.xml: < Code> & lt ;! - A bidet's outout is used as the top-level content view using match_parent for both the fourth and the eighth space available. - & gt; & Lt; Android.support.v4.widget.DrawerLayout xmlns: Android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" Android: Id = "@ + Id / drawer_layout" Android: layout_width = "match_parent" Android: layout_height = "match_parent" tool: reference = "bernd.slider" & gt; & Lt; FrameLayout Android: id = "@ + id

How to create database for a Semantic Logging Application Block with SqlDatabaseSink -

How to set up a SQL Server database for semantic logging Should the logging information be hosted first? If yes, then what is the schema to use. I have the following code: var listener = new ObservableEventListener (); String Connection String = @ "Data Source = Nebak 2025; Initial Catalog = TreeDatabase; Integrated Security = True; User ID = SA; Password = EnS @ 123"; Listner. Competent agent (auditing and asset source logs, event level.loggelegs, keywords. All); DatabaseSubscription = listener.LogToSqlDatabase ("Test", Connection String, "Mark", Buffering. Default Buffering Interval, 1, Timeout: Inter Time, 500); // The following one line of code is not part of this function. // This is just to show how I log in to my information // inside the log-in method I write 'Write' method auditing Avent Source. Logs. Call Corporation ("sgsgg", "sgsg"); DatabaseSubscription.Sink.FlushAsync () Wait () .; OK, because this t

oracle - Is it possible to use the Proxy authentication toward an External authenticated user? -

Suppose i have three users a, b, c, three of them are defined as external authentication (Three OS users are the same machine) Now think about the WS, which usually receives the user / password information from the customer (where A, B, and C are) and connect to the cloning database of A, B and C. . What will not work in this scenario, because WS is on another machine, and can not provide passwords for A, B and C DB connections. I was thinking about making a user D, the external is not certified, and D to gran Proxy Authentication so that he could be able to connect as A, B and C. Will he work? Do I just need to run the following? ALTER USER D Connect a change via user D permit Connect the user D permutation through B. C and I connect to WS How do I apply? Do I need to feed usernames? It is possible to turn, but this should be the second way to get out. You can change user A, B, C to join D, which will allow you to connect to a user name as D. The only thing to re

integer - Convert 1,000,000 to 1.0E6 In JavaScript -

I'm wondering how can I change the 1,000,000 to 1.0 e6 in JavaScript. Do I want the full contrast of the parseInt function? Many thanks! 1000000 and 1.0 e6 Javascript is evenly noticeable. The function parseInt (string [, radix]) simply converts the string into number by radix. You can use intValue.toString (radix) to convert back to the string

Form EMPTY select option to PHP -

Look around and find answers to my problem I have PHP, My Selection Code & lt; Form id = "contact-form", but I can not select the option (it remains empty), no choice. & Gt; & Lt; Select ID = "topic" name = "topic" class = "form-control" required = "required" & gt; & Lt; Option value = "" selected = "" & gt; Escriber: & lt; / Options & gt; & Lt; Option value = "Service" & gt; General customer service & lt; / Options & gt; & Lt; Option value = "Suggestion" & gt; Suggestions & lt; / Options & gt; & Lt; Option value = "product" & gt; Product Support & lt; / Options & gt; & Lt; / Select & gt; & Lt; / Form & gt; My PHP code & lt ;? Check for Php // blank field (below ($ _ POST ["name"]) | below ($ _POST ["email"]) below ($ _ POST ["subject"]) below

node.js - Does socket.io upgrade transport to websocket from polling ? -

I am using nodejs with socket.io and express frame work. The following output is what I get when I run the command The log output is low. Stop request for engine path "/socket.io/" + 2m engine handling "receive" http request "/socket.io/?EIO=3&transport=polling&t = 1414498393419-0 "+ 0ms engine Handsing client" WECN1dP0tobacKc8AAAB "+ 1ms engine: socket send packets" open "({" sid ":" WECN1dP0tobacKc8AAAB "," upgrade ": [" websocket "]," Pingintrvl "25000" Pingtaimaut ": 60000}) + 0ms engine: polling setting request + 0 engine: socket Flushing buffer transport + 0 engine: voting writing" 0 { "sid": "WECN1dP0tobacKc8AAAB", "upgrade": [ "websocket"], " PingInterval ": 25000," PingTimeout ": 60000}" + 1ms en Jan: Send socket execute batch callback + 1ms socket.io:server incoming connections wi

java - How to validate HTML using JTidy? -

I want to validate my html using JTD. I want true or false feedback if it is valid or not currently I am using this code. string html data = " gt; gt; & lt; / head> gt; & lt; body & gt; & lt; div & gt; ; Hello Java & lt; / div & gt; & lt; / body & gt; & lt; / html & gt; "; Clear clean = new clean (); InputStream stream = new bytereinputstream (htmlData.getBytes ()); Lowly Pars (stream, system out); Is there any way or method through which I get a Boolean response whether my HTML is valid or not? According to the documentation, you can use the total error numbers for your final parse operation. Then you can do something like this Private boolean is Valid (string HTML data) {Clear clean = new clean (); InputStream stream = new bytereinputstream (htmlData.getBytes ()); Lowly Pars (stream, system out); Return (TDGetter's Errors) == 0); }

java - Viewing console output when web application is running on Amazon Web Services -

I know that this is a very simple question, but I am new to Amazon Web Services and all of my help The requirement that I can receive is When I run my web application locally, I can debug it to insert the print statement within the code, to see if the statement is executed or not (I look at the console output). Now, when I upload an application to AWS, I get errors in the code. I do not get these errors when I run the application locally, so I have to debug it. Is there a way to see the print statements output when an application is running on an Amazon instance? Can I do SSH in the example from my local computer when code is running remotely, is it possible to use the same debugging technique? Thank you. Yes this is possible. Anything you see in the console should be logged into the catalina.out file automatically. The file should be located below: $ CATALINA_HOME / log / . You will probably note several files like: catalina.yyyy-mm-dd.log . This is because Tommak uses a

php - SQL Order by ... ASC -

Image
I have problems with SQL queries. I want to sort my results in ascending order, but the problem is that DB According to the first data, the results give, whereas logically, 2 should be before 19 for example. Here is my request and a screenshot of the result which does not go at all: SELECT * by mail 'WHOER' as the title '% $ MT%' ORDER BY mail. Titre asc < P> All the results have been solved what I want: 1 2 3 4 5 ... 101 102 103 ... 8845 8850 ... and so on. Do you have an idea of ​​this problem? Regards. I think the column is deprecated because char . Therefore, the DBMS string value is being sorted by. You have to convert your values ​​to int in the ordered segment. SELECT * By typing '% $ MT' 'by order and convert (mailtitter, unsigned integer) ASC

wpf - Visual Studio 2013 Extremely Slow at Saving Files -

Image
I have a WPF project where it sometimes takes a very long time to save the module. (I see little savings floppy "forever" pulsating and nothing happens for a few minutes). Often I will have to use the task manager to finish the Visual Studio and again after restarting again for the first time, the savings are very fast, but then it takes forever. Any problem to solve this problem would be greatly appreciated. > Resolve> problem> in Source Control by setting up the source control plug-in on "none", which is okay because we TFS or Git are not used. It is not certain why this works, but Visual Studio does not "hang" after this change. < Div class = "post-text" itemprop = "text"> Here are some steps you can follow to increase performance via Solution Explorer Go to a xaml file, right click on ... select the source code (text) editor and set it as default. Go to Tools> Options> Text Editor>

vb.net - I can't understand what means this line of code -

I am reading an old code written with VB and I do not understand that it means that the code This line is CType (cache ("table"), array) (CINT ("LG"), 0) = myValue Also please help? Set a multi-dimensional array using values ​​derived from this cache object Used to be. Another readable code can be something like this: form an array of arrays = sitep (cache ("table", array) in the form of dim introservation In integer = CINT (cache ("LG")) your intent (intposition, 0) = myValue

Launch Android app linking with particular url -

Can anyone tell me how to launch Android application with a special URL. If I am getting this URL by mail. Please suggest how I can open the app on a special URL. "post-text" itemprop = "text"> One option is to be a web site, and that web site has an intention-filter for a specific URI. For example, this is what the market prevents URI on its website: & lt; Intro-filter & gt; & Lt; Action Android: name = "android.intent.action.VIEW" /> & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; Category android: name = "android.intent.category.BROWSABLE" /> & Lt; Data Android: scheme = "http" Android: host = "market.android.com" Android: path = "/ search" /> & Lt; / Intent-Filter & gt;

java - libGDX - Scrolling background by dragging mouse -

I am trying to use a mouse-scroll background to use libGDX. I have already created an infinite loop in the background, but I do not know how to scroll it by dragging the mouse. Is the proto processor the only way to make it or is there any easy way? If so, do you know any tutorials about using mouse dropping method in the embed processor? I'm just a knot with LGGDX, so if possible give a specific answer. a gesture listener PAN: A user Draws a finger on the screen. The detector will report the current touch coordinates as well as the delta between current and previous touch positions. Useful for implementing camera panning in 2D @ Override public boolean pan (float x, float y, float deltaax, float delta) {camera.position.x + = deltaX; Camera.update (); return false; } With this code you are about to move your mouse whenever you drag your mouse (finger on device) read the link from the document.

search - Magento code changes in local don't work -

I am trying to fix the Magento search issue where usage is used to compare multiple search terms instead of 'OR' is done '. I have made a lot of suggestions on the Web how to fix it, and the general idea is as follows: Copy app / code / core / Mage / CatalogSearch / Model / resource / Fulltext.php to app / code / local / pamphlet / catalog search / model / resource / full text Php and copy, for example 'or' from 'and' and ', where SQL queries are formed. However, my changes do not work as expected and which is more confusing is that the prepareResult () method (where the above changes are made to SQL) Even after completing it does not seem like this. I tested it by inserting some debugging code in the function. I used the same debug code to make sure that the file has been loaded. But the debug code is not run when the readyResult () function is inserted on. (Debug code originally writes to a file on disk) What am I missing here?

vba - Pulling Data from MS Word Textbox into Excel -

I have anywhere in the area of ​​300 evaluated forms and they have to be opened in turn and some data should be excluded in Excel. It seems to me some VBA so far I have this ... objWdDoc error as object dim as objWdDoc error set as object objWdApp = GetObject (, "Word.Application") if Err.Number & lt; & Gt; 0 then end objWdApp = CreateObject ("Word.Application"). If the error occurs, then go to error. Set up objWdApp = SetObject ("Word.Application") objWdDoc = objWdApp.Documents.Open (Filename: = "U: \ PDR \ NewProcess \ Mike Hibbert.docx") objWdApp.Visible = False Range ("A1 ") = ObjWdDoc.textName.Value objWdApp.Quit set objWdDoc = nothing set objWdApp = nothing but this is the range (" A1 ") =" objWdDoc.textName. To understand the error at run time error 438 it has not run through all the objects in a folder etc., but at this level I have some word in Excel I would like to get the data. S Mike

c# - How should a controller be excluded on publish? -

I have a UNITST controller running a Jasmine test against the JavaScript code, which is a .NET MVC project. However, I do not want to be available when publishing the site. I am thinking about some ways to do this, but I'm not sure what will be the best Use those authorization features Which are being started to refuse to access it Remove the controller from the collection of actually available paths I keep things simple Iman is using the compiler instructions for this ( #IF DEBUG ) Of treachery, I think that the controller would be better options to overcome, but I'm not sure that he will place. Probably the Global C file? I appreciate any suggestions if access to the controller is the best solution, so it is fine, and something that I can easily apply on my own. I think that should be a better way. You can simply ignore the route conditionally: #if! DEBUG routes.IgnoreRoute ("UnitTest / {* pathInfo}") #endif Although it is not very differ

What is the best practice to position an element-float or positioning? -

First of all, I should accept that I am making a beginning and the question may seem strange to most of you Sorry for that. My question is - what is the best practice (float or position) in the position of an element in 2 or multiple column layouts to break the design habit after zooming a website? I searched through this site and searched for some posts about this issue but those are 4/5 years old and I can not come out of any conclusion. Looking for your expert's ideas .... Thank you .. It is true that where you want to put your element or inside the page should be kept. CSS status: If you want to show the element above or below any other elements, even selecting CSS conditions to position your element And if you want to make them live. Floats: To make columns, the content is left or right aligned and to accommodate its adjacent siblings - You should use CSS Floats. We say, you have a bunch of images and texts, if you want to wrap texts around the image

c# - Using a fluent security custom policy with castle windsor -

I have flint security setup (and work) to protect my controller tasks and I have to solve everything The castle used Windsor (too much you can download castlewindsor-fluentsecurity is shown in the project). What I want to do now is creating a custom policy that runs queries on our Active Directory. I have created a test policy that implements the ISecurity policy but I do not have a default constructor because I need to inject the interface to reach AD. Here's the policy: - Public class test policy: iCity Policy {Private Readonly IQueryHandler & lt; GetUserQuery, Users & gt; UserQueryHandler; Public Testing Policy (IQueryHandler & lt; GetUserQuery, User & gt; User SearchHandler) {this.userQueryHandler = userQueryHandler; } Public Policy Result Enforce (Escrowity Contact Reference) {var adUser = userQueryHandler.Handle (New GetUserQuery ()); If (adUser.HasManager ()) {Return PolicyResult.CreateSuccessResult (this); } Return Policy Results Create FileResult (th

html - inline-block vertical centering issue -

I have the following simple code snippet. It is taken from my application where A1 is a container button, in which there is an icon, the icon should be raised vertically by the parents-line height / height, but it has been moved from above to 1px Can you please explain to me why this behavior is ? Is there a solution? .a1 {display: inline-block; Width: 28px; Line-height: 28px; Background-color: # 000; Text align: center; Vertical-row: middle; } .i {display: inline-block; Width: 16px; Height: 16px; Background color: #F00; Vertical-row: middle; } & lt; Div class = "a1" & gt; & Lt; I class = "i" & gt; & Lt; / I & gt; & Lt; / Div & gt; Why? Because inline block elements present with "white-space" you can see it in this , where there is no height / width on the original element . When you vertical-align: medium; , the "white space" element is provided before (at the top) (black line in the

java - How to drag a JavaFX node and detect a drop event outside the JavaFX Windows? -

I am implementing a tabkin that can be separated from the JavaFX window. When the tab panel is pulled out of the window where it came from, I have to create a new window and the tab to be placed in that window. I have already applied some methods using drag gestures, drag the tab between the existing window. However, when I'm taking a mouse out of javax sequences, I'm not able to get any mouse events or drag events. Is this something possible? You can listen to a mouse release incident on the appropriate node (like the graphic of the tab). Check the screen coordinates using MouseEvent.getScreenX () and MouseEvent.getScreenY () and see if they are out of the current window. If they do, create a new window, view and tab panel; Remove the tab from the current tab panel and place it in a new location. There is no fundamental example with no frills (for example, a user does not indicate that the dragging is happening), but you should consider this: import Please

ios - MapView doesn't ask for location permission -

I'm trying to create a map view in Swift. It has already been working but something is changing, after which I do not remember, I am getting the following error now: Mapicat location without prompting for location authority Trying to start the update. Calling is required - [CLLocationManager requests when inauthority] or - [CLLocationManager requestsNow always authorization] Firstly. NSLocationAlwaysUsageDescription is in my .plist file. Here is the code: Import UIKit import macquet class AwesomeMap: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate {var map: MKMapView? Var Manager: CLLocationManager? Function setup () {! Manager = CLLocationManager () manager .delegate = self-map = self // Show being .delegate set another controller manager .requestAlwaysAuthorization () manager .startUpdatingLocation ()!} LocationManager (manager function: CLLocationManager!, DidChangeAuthorizationStatus position: CLAuthorizationStatus ) {println ( "permisison r