Wednesday, 15 February 2012

html - Setting proportional column width with <col width="x*" /> -


मैं आनुपातिक कॉलम चौड़ाई को और lt> col width = "x *" / & gt; :

  & lt; तालिका की चौड़ाई = "600px" & gt; & Lt; कर्नल चौड़ाई = "1 *" / & gt; & Lt; कर्नल चौड़ाई = "2 *" / & gt; & Lt; कर्नल चौड़ाई = "3 *" / & gt; & LT; tbody & gt; & LT; टीआर & gt; & LT; टीडी शैली = "सीमा: 1px ठोस काले;" & gt; एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए एएए & lt; / टीडी & gt; & LT; टीडी शैली = "सीमा: 1px ठोस काले;" & gt; BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB & lt; / टीडी & gt; & LT; टीडी शैली = "सीमा: 1px ठोस काले;" & gt; सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी सीसीसी & lt; / टीडी & gt; & Lt; / टीआर & gt; & Lt; / tbody & gt; & Lt; / तालिका & gt;  & lt; col & gt;  टैग में कॉलम चौड़ाई समान रूप से निर्धारित करने के बावजूद  

मैं क्या कर सकता हूं?

आप 17%, 34%, और 49% का उपयोग कर सकते हैं 1: 2: 3 के लिए


.net - How do I reference classes using IronPython? -


I want to use IronPython as a simple test for a .NET application. I have created a project in Visual Studio 2008 and have an empty Python source file. I have added my assembly to this project in Visual Studio. I am familiar with general dragon programming.

How do I import and use sections from my referenced assemblies?

ASP.NET how to create container control which will have exactly two containers? -


How to create a web control in two containers in ASP.NET 3.5. As always, exactly two columns (divs). I know that by default, you allow the control collection override the CreateControlCollection () method, but whis allows you to only contain one container (or variable number of the container). Is there always always a way for two containers in web control?

I want to store something like this:

  & lt; MyControl & gt; & Lt; LeftContainer & gt; ... & lt; / LeftContainer & gt; & Lt; RightContainer & gt; ... & lt; / RightContainer & gt; & Lt; / MyControl & gt;  

There is no way to do this in ASP.NET 3.5

< / Div>

java - Using maven to distribute a swing application that can have each dependency individually tracked -


I'm going to OSGI at my project and finally I currently distribute this project with all the dependencies one Although my projects are only 20% of the total package, I have to redistribute all dependencies. This can also be lower with smaller independent modules.

It seems that to keep my current plan, maven-assembly-plugin should do the trick.

I am a base installer who will look at an XML manifest, then gather all the libraries that need to be updated. This will mean that sometimes the changing libraries will be downloaded less frequently. It also makes for some things like OSGI plugins (which can be free release schedules). To summarize, I want to download and manage my software on individual libraries and download it on demand (by manifest).

I was wondering if there is a "Meven Way" to prepare this manifest and publish it to a website on the library? I believe the deployed life cycle will be the second step.

As an alternative, is this an open source Java library deploying this type of thing? I do not want to embed anything bigger with Maven or distributed code. This application is simple and not good for codecs, and as small as the installer.

It seems that this is an ideal case, especially when you already have dependency on the webserver I'm not thinking that Maven has the WS plugin; I miss the written code for Maven 1 to do the job.

If you want to see the implementation of WebStart, then I recommend the FindBugs demo page: - You will see a link in the second paragraph.


Ruby: Time difference in percentage? -


How do I, for example, know that between 4:00 and 8pm, at 6:00 p.m. 50%? Or is it 50% between 12 o'clock Wednesday 12 and Tuesday 12am?

Convert from seconds to seconds, calculate the difference between your desired time and the first time in seconds, Calculate the whole duration fraction, and then multiply by 100%

12 AM = 0

12 PM = 43200 seconds (of day)

Your desired time = 3 AM = 10800 second of the day

Total time duration = 43200 - 0 = 43200 seconds

Time difference of your desired time from the first time = 10800 - 0 = 10800 seconds

Fraction = 10800/43200 = 0.25

percent = 0.25 * 100% = 25%

(Sorry Ruby does not know, but its idea .)


how to pass "this" in c++ -


I am confused with C ++ in the keyword this, I'm not sure if I Here's the piece of code I am struggling with:

  Class A :: Class A (Classbie) And B) {B.Denth (this); // Passing my pointer and trying to call the regularity of B, should I use "this"? } ClassB :: doSth (ClassA * a) {// do sth}  

This indicator indicates the current object instance.

class assistant {public: zero help (worker * pWorker) {// do something with TODO pWorker. . } Do something with zero help2 (worker and rWorker) {// TODO RWorker. . }}; Class worker {Public: Dowr (without) {// This takes a worker pointer, so that we can use this indicator. Helper.help (this); // To pass from context, you will have to reproduce this pointer again. Helper.help2 (* this); } Assistant Assistant; };

Also, say that you declare worker * PW = new worker () . If you call a method (Dovor) on the PW object, you will see that this

pointer and pw have the exact same value (both of them are the same address) ).

(To make sure that it produces, but I do not think it should).


c# - How to host an IronPython engine in a separate AppDomain? -


I am using the code below to execute IronPython scripts on different "appdomain" c #. The scripts that take a short time (at least 3 minutes) perform fine.

(I used this approach to solve the memory leak problem) but if the script throws say an exception takes a long time (more than 5 min) -> System.Runtime.Remoting. RemotingException: object '/011b230e_2f28_4caa_8bbc_92fabb63b311/vhpajnwe48ogwedf6zwikqow_4.rem'

system; Use of Microsoft Namespace PythonHost Sample {Class Program {Static Zero Main (String [] ARGs) {App Domains Sandbox = Appdomain. Crete Dominen ("Sandbox"); Var Engine = IronPathon. Hosting Python.CreateEngine (sandbox); Var Search Path = Engine GetSearchPaths (); SearchPaths.Add (@ "C: \ Python25 \ Lib"); SearchPaths.Add (@ "C: \ RevitPythonShell"); Engine.SetSearchPaths (searchPaths); ScriptScope scope = engine.ExecuteFile ( "C: \ Python25 \ Test.py") // script morethan to execute 5 mi (sleep) ObjectHandle Oh = scope.GetVariableHandle ( "GlobalVariableName" script) // system exception following Throw takes / /System.Runtime.Remoting.RemotingException: // object '/011b230e_2f28_4caa_8bbc_92fabb63b311/vhpajnwe48ogwedf6zwikqow_4.rem' Console.ReadKey (); }}}

InitializeLifetimeServices be null general approach to override and return. I suspect that it is possible in your case. There is another way involved in the App.config file.


mysql - Any site out there that let's me run test SQL queries on sample databases? -


You want to test some sampling data in the browser without installing a DB engine and you do not have any Also a remote access to cloud database?

Yes, me too. Suppose it is for educational purposes MSSQL or MySQL SQL SQL would be nice.


java - How to add local dependencies in buildr -


I have some dependencies for the Java / Scala project, which are not in a remote repository but my files are somewhere else in the system.

I have two options which give rise to questions:

  1. I can add a lib / directory to my project folder . How can I tell the builder to add content to the classroom path?

  2. I can use built-in dependency management system. Can I point to a file system repository path instead of an http?

thanks

The code> buildr was looking into the mailing list. compile.with () The method accepts an array of file names (of course with the path prefix). So if dependencies are jars in a directory called lib then you can call:

  compile.with Dir ['lib / * *. Jar ']   buildfile  in 

. Hope this will help other buildr Apets.


javascript - How do I get colors to work in sIFR 3 r436? -


I've found it; You can see the source of what I am trying to do.

As you can see, everything works out of it except the colors. I'm trying to set the color to blue (# 0000ff), but it's black. I have created a Custom SWF file for my font, so that it can be embedded in four different forms of a single font to adjust for different styles (since this particular font family has regular, bold, italic and bold italic four Stores the dissected font as names). / P>

For future generations, I will paste some source code from the demo page that I link here:

  & lt; Style type = "text / css" & gt; H1.sifr {color: # 0000ff; Font-family: 'innumerable pro'; Font-size: 1.75 names; Margin-down: 0; } & Lt; / Style & gt; & Lt; Script type = "text / javascript" & gt; Var myriad_pro = {src: 'myriad_pro.swf'}; SIFR.activate (myriad_pro); SIFR.replace (myriad_pro, {selector: 'h1.sifr', css: {'.sIFR-root': {'color': '# 0000ff', 'font-family': 'Mayyaad Pro'}, 'em' '' 0000ff ',' font-family ':' Myriad Pro Italic ',' Font-Style ':' Plain '},' Strong ': {' Color ':' # 0000ff ',' Font 'Maryhead Pro Bold' , 'Font-weight': 'normal'}, 'strong, strong M': {'color': '# 0000ff', 'font-family': 'mylied ed bold italic', 'font-style': ' Plain ',' font-weight ':' normal '}}}); & Lt; / Script & gt;  

What did I forget? How can I work in color?

I have to do this work, the only difference is that my CIFR text is attached to the link, and this mouse Color changes on hover.

My script looks like this:

  & lt; Script language = "javascript" type = "text / javascript" & gt; //sIFR.useStyleCheck = True; Var Eurotique = {src: '/images/eurostile.swf'}; SIFR.activate (Eurostile); SIFR.replace (urotype, {selector: "div # mainNav li", wmode: "transparent", CSS: ['a {text-decoration: none; color: # 666666;}', 'a: link (color: SIFR.replace (eurostile, {selector: "div.menuHeadingText", wmode: "transparent", css: ['.sIFR- Root {color: #FFFFFF;} ',' a {text-decoration: none; color: #ffff;} ',' a: link (color: #fffff;) ',' a: hover (color: #ff5 AIF; A '}}); SIFR.Rayle (Eurotile, {selector: "H2 box heading", wmode: "transparent", css: [' .sIFR-root {color: # 666666;} ']} ); 

Hope it helps.

/ Klaus < / P>


sql - How do you find out the DayOfTheWeek given a datetime in MySql? -


Looking at a datetime column in mysql 5, do I want to know the day of the week?

But DayoffWeek returns 1 for return on Sunday.

I have to represent 1 Monday, 2 on Tuesday etc. And 7 is to denote Sunday.

Is there a one-liner (which can be embedded in a large SQL statement) that executes this function?

  f (x) = & gt; Y as such: f (1) = 7f (n) = n in n -1 category [2,7]  

is a purely arithmetic formula

  SELECT ((DAYOFWEEK (myDate) + 5)% 7) + 1 In Monday, we often select  Case Statement  (Answer to CF Attendant)  
  in SQL when DAYOFWEEK (myDate ) = 1 THEN 7 ELSE DAYOFWEEK (myDate) -1 END as MondayBoundDaw  

Now ... MySQL also provides the function WEEKDAY () which will be is similar to DAYOFWEEK () , but

  • Monday-based
  • zero-based

i.e. Monday = 0, Tuesday = 1 ... Sunday = 6
So you can just use

  Monday to Monday as SELECT WEEKDAY (myDate) + 1 < / Code> 

But definitely using modulo arithmetic is less fun; -)


Textmate, open file at Caret -


I'm sure this is really clear but I do not know how to open the cassette file, which is currently in the school. For example, in Dreamweaver's choice you can & lt; A href "index.html" can click on the index.html section of the CMD-D hit and it opens this file in a new tab. Is this possible?

It would be nice to do this with the and to open the file directly in Photoshop.


Resolved! Patrick's solution below.

I used a modified version of the above Dastin 777 to make a command called OpenAyart. The command is: Open "$ TM_PROJECT_DIRECTORY" / "$ TM_SELECTED_TEXT"

I then raised it by installing a macro, which allowed you to select a path between double quotation marks, but the quotes Did not include. I got here with the Macroats board

To wrap them both together, I put my cursor in a path and entered a new macro, where I select "double quotation marks" and then Open katakar command I then named this OpenProjectFileAtCaret and forced this macro to CMD-D.

One behaves and is used all the time just to be sure that you have the right default app setup for each file type, as you are opening the textmat for PSP, ASP, HTML and this Will open in a new tab

I do not have a complete solution as link bundle but you should close it.

You can use the bundle editor to create a command which will open an image if you choose the path. Create a new order and enter it:

  Open "$ TM_DIRECTORY" / "$ TM_SELECTED_TEXT"  

input selected text Or words
Skip

Close editor Now you select an image path You should be able to and it will open when you press the appropriate keyboard shortcut.

You can add a flag to the open command, to specify which application to which the selected file is located. This is just a basic example and is not a complete solution that will work with every type of file path.

You can find information on the SystemMat environment variable.


JQuery Animation fails randomly -


I tried to apply jQuery animation to my site, but randomly after seconds, minutes or hours, the animation An error throws: "Invalid property value" line 154 four 4889 jquery-ui-1.7.2-custom.js.

Here my code is:

  $ (idTimer) .animate ({background color: '# aa0000', color: '#ffffff'}, 1000) ; $ (IdPrice) .animate ({backgroundColor: '# aa0000', color: '#ffffff'}, 1000); $ (IdTimer) Animate ({backgroundColor: '#ffffff', color: '# f67802'}, 1000); $ (IdPrice) .animate ({backgroundColor: '#ffffff', color: '# 000000'}, 1000);  

Of course the IDs are set correctly. When the animation is hanging, no animation will be done for this edition, so it is very mysterious. Please help with this.

Here is an unsuccessful code from the beginning of 4889:

  h.elem.style [f] = "RGB (" + [math max. (Math.min ParseInt ((h.pos * (h.end [0] -h.start [0])) + h.start [0], 10), 255), 0), Math.max (Math.min (parseInt ( (H.pos * (h.end [1] -h.start [1])) + h.start [1], 10), 255), 0), Math.max (math minutes (parseInt ( Joining .pos * (h.end [2] -h.start [2])) + h.start [2], 10), 255), 0]]. (",") + ") }});  

Try this type

  $ ( IdTimer) .animate ({'backgroundcolor': '# aa0000', 'color': '#ffffff'}, 1000);  

Problem in jQuery and XmlHttpRequest -


I'm trying to call a PHP page with XmlHttpRequest (AJAX). My problem is that I have JPL (JavaScript) in my PHP page like this:

  & lt; Script language = "javascript" src = "jquery.js" & gt; & Lt; / Script & gt; & Lt; Script language = "javascript" & gt; // my jquery code here & lt; / Script & gt;  

When I call the PHP page with XmlHttpRequest, it fails! That is, the response shows only PHP content, but jQuery is not working! When I work directly from that PHP page

So, how can I fix this problem?

You probably have your own jquery code like this:

  $ (Document) .ready (function () {// some magic}};  

The fact is: If you load it through AJAX it will not be a fire.

To run it, you only have to remove $ (document). Already part

You can also read.


dynamics crm - Make AJAX request from MS CRM events -


I have an AJAX request to a script Onvev event of a form in MS CRM Dynamics 4.0. Now I have the code

  var http_request; //xmlHttpObject ready and send the request. Try {http_request = New ActiveXObject ("Msxm12.XMLHTTP"); } Hold (e) {try {http_request = new ActiveXObject ("Microsoft.XMLHTTP"); } Hold (e) {warning ("something went wrong .."); }} Var poststr = "foo = bar"; Http_request.open ("POST", "/folder/index.html", Incorrect); Http_request.setRequestHeader ("content-type", "text / xml; charset = UTF-8"); Http_request.send (poststr); // capture results var resultXml = http_request.responseText; Warning (resultXml);  

The alert now gives me the content of a 404-type error, I'm sure that is the page, it is available through the browser. If I change the http_request.open ("post", "/folder/index.html", incorrect);

http_request.open ("post", "localhost: 5555 / folder / index.html", false);
Fails () fails, "Permission denied"

update (7th December 2009);

I have created a virtual directory in the ISV folder of the CRM and have to raise an asp.net application. Now, if I go to crm.url.nlitter555/ISV/Default.aspx I;

'Microsoft.Crm.WebServices.Crm2007.CookieAndSoapHeaderAuthenticationProvider, Microsoft.Crm.WebServices, Version = 4.0. 0.0, Culture = neutral, Sarwajnikki token = 31bf3856ad364e35 'does not exist Parameter name: Microsoft.Crm.WebServices.Crm2007.CookieAndSoapHeaderAuthenticationProvider, Microsoft.Crm.WebServices, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35

with stacketres;

  [ArgumentException: 'Microsoft.Crm.WebServices.Crm2007.CookieAndSoapHeaderAuthenticationProvider, Microsoft.Crm.WebServices, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' does not exist. Parameter Name: Microsoft.Crm.WebServices.Crm2007.CookieAndSoapHeaderAuthenticationProvider, Microsoft.Crm.WebServices, version = 4.0.0.0, culture = neutral, PublicKeyToken = 31bf3856ad364e35] Microsoft.Crm.Authentication.BaseAuthenticationSettings.CreateType (string type name, type essential BaseType ) + 265 Microsoft.Crm.Authentication.BaseAuthenticationSettings.CreateProvider (String type name, IDictionary`2 configuration) +28 Microsoft.Crm.Authentication.AuthenticationPipelineSettings.LoadPipeline () +262 Microsoft.Crm.Authentication.AuthenticationPipelineSettings.get_AuthenticationProvider () +16 Microsoft .CRM. Authentication Authentication Engine.Execute (Object Sender, EventArgues E) +524 System Web. Synchronize Execution Steps. System. Web. Hpapackification. IECC actionstep. Exit (+68 system) Web. Acteepiapikkrn.aksakyutstep (IExecutionStep step, Boolean and Sinkronsn full) + 75  

Does anyone have any ideas? .NET application only writes a word of response, not because there is something special ...

Okay, I found out what the idea is that you want to call an AJAX call from CRM 4.0 to a dynamic .NET application, here's what you do.

Put the assemblies of your net application in the CRMWeb / bin folder in the CRM folder. Put the ASPX files into the folder in the ISV folder, I used the stunnware.com folder because it was there, but you might want to create another folder for dexterity after that, on-the-go (or in any on-event) Put something like this;

  var xmlHttp = null; XmlHttp = New ActiveXObject ("Microsoft.XMLHTTP"); Var getstr = "foo = bar and foo2 = bar 2"; Var url = prependOrgName ("/ ISV / * YOURFOLDER * / Default.aspx?" + Getstr); XmlHttp.open ("GET", URL, true); XmlHttp.send (zero);  

Of course, if you want to do anything with the reaction of the CRM XML-Request, you can use onreadystatechange for it.

Hope this can help other people. It may seem straightforward, but I found out how to do this (although I knew how to use AJAX and .NET and accessories). I think it's a shame that CRM developers are left in the cold by Microsoft. They should be put in the SDK document for some time and how to do it.


dojo - DIJIT TabContainer display problems in IE7 -


Instead of being displayed horizontally in IE7, I'm having a problem with a tab container displayed tab. Firefox 3.5 is OK.

My setup is as follows: There are 5 tabs in the tab container: CSS is defined by the custom CSS file in the container. Each tab can have a new tab container. This 'Inner' tab container default Tundra CSS Uses styling.

The 'Inner' tab container works fine, and displays tabs horizontally, but 'external' tab container (with custom CSS) does not. I thought that solving this problem would be straight ahead, because I was only able to copy the styles related to Tundra Style Sheets. Unfortunately, it does not seem to work. I've checked the display values ​​of the calculation css for all the internal and external tabs and they match, so I'm a bit of a loss .......

Anyone had this kind of problem before?

Oh, and another, a little confusing issue ............ If I say "Display: Inline-Block;" To do .dijitTab, I have the same problem in Firefox.

It is difficult to tell without seeing your custom CSS, but TabController has a Recortect RTL tabbel () method The same problem which fixes


Page generation time - ASP.Net MVC -


I see how long it will take for the page generated by the server. I know that I can use the trace to track it, but I need a way to display this per page

its ASP.Net MVC 2

Yes Yes Daryn suggestion is the standard way to do this in an ASP.NET application, I will just add that if any non-HTML If the interactions do not interfere, edit: Edit: Completed implementation added A: Public class PerformanceMonitorModule: IHttpModule {Public Zero Init (HttpApplication Reference) {context.PreRequestHandlerExecute + = Representative (Object Sender, EventArgs E) {// Set Page Timer Star HttpContext requestContext = ( (HttpApplication) sender) .Context; Stopwatch timer = new stopwatch (); RequestContext.Items ["Timer"] = Timer; Timer.start (); }; Context.PostRequestHandlerExecute + = Representative (Object Sender, EventArgs E) {HttpContext HTTPContext = ((HttpApplication) Sender) .Context; HttpResponse response = httpContext.Response; Stopwatch timer = (stopwatch) httpContext.Items ["Timer"]; Timer.Stop (); // Do not interfere in non-HTML responses (feedback.contact type == "text / html") {double second = (double) timer. Appletics / Stopwatch Frequency; String result_time = string.format ("{0: F4} seconds", seconds); RenderQueriesToResponse (response, result_time); }}; } Zero RenderQueriesToResponse (HttpResponse response, string result_time) {response.Write ("div style = \" margin: 5px; background color: # FFFF00 \ "); response. Type (string format (" & lt; b & gt; ;); Response.Write ("& lt; / div & gt;");} Public Zero Extraction () {/ * Not Required}} P> You can also add some style to it ...

And remember to register your module in the webcontent section within the http module:

  and no Steven Sanderson - Chapter 15 - Demonstration of Pro ASP.NET MVC Framework for a complete reference in this regard - Addition = "Name" type = "Namespace, dll" />  

, Monitoring page generation time.

Edit: (Comment @ Pino) ​​Here is an example of my project:


javascript - removing a div and focusing input field next to it -


मेरे html ऐसा है

  & lt; td & gt; & Lt; input type = "text" class = "textinput" id = "file_descr_0" नाम = "file_descr [0]" मान = '' / / gt; & Lt; div id = "मतलब" onClick = "हटायें एलेमेंट ('मतलब');" & gt; {L_FileDescr} & lt; / div & gt; & Lt; / टीडी & gt;  

और div को निकालने के लिए मैं इस फ़ंक्शन का उपयोग कर रहा हूं

  फ़ंक्शन निकालना एलेमेंट (div) {var d2 = document.getElementById (div); Var d1 = d2.parentNode; d1.removeChild (डी 2); }  

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

और भी इनपुट फील्ड पर कैसे ध्यान केंद्रित कर सकता है।

धन्यवाद।

  & lt; div onclick = "हटायें एलेमेंट (यह);" & gt; {L_FileDescr} & lt; / div & gt; फ़ंक्शन निकालना एलेमेंट (डी 2) {var d1 = d2.parentNode; d1.removeChild (डी 2); // संपादित करें भी: d1.nextSibling.firstChild.focus (); }  

sql server - Split string returning a record -


I have a column table that looks like this:

  gaming | Austria | 47.9333, 15.1 Hebei China |  

This means that each line is a single string (VARCHAR), which contains some locations, with different fields by a pipe (|).

I would like to write a query which gives the following:

  ------- ---------- ------ ----- ---------------------- Gaming Austria Gaming | Austria | 47.9333, 15.1 Hebei China Hebei China |  

Which means that I want 3 columns: for city, country, and original column.

The city is easy to split (combination chrinedex and subbrassarring), it seems more challenging to remove the country, for hard part, know the length of the country's area in the string, so it should be removed using SUBSTRING. Could.

I realize that I might have to type a SPLIT function in T-SQL, but I'm not sure how to write one which gives the data as a record and not in the form of a table.

Signals and / or solutions will be more than welcome.

Specifying the correct starting position and dynamically depending on the position of the delimiter within the string A case of calculation- such as D. Shows up with some extra tweaking:

  substring (fieldName, 0, charindex ('|', fieldName, 0)) as a city, substring (fieldName, charindex ('|' , FieldName, 0) +1, (Chirendex ('|', Field Name, ('' ',', Field Name, 0) +1)) - Charindex ('|', Field Name, 0) - 1)) Note that, as a country, the right (field name, as well as it may want to compare it with a CLR-based partition function, charindex ('|', reverse (field name), 0 ) -1) As Coordinate  

Un Variety of possibilities that they are highlighted.


find regex pattern in Vim -


  कुछ पाठ मुझे कोई परवाह नहीं है, some_text_i_want, & lt; गुंथे हुए रिक्त स्थान & gt; Some_text_i_want,  

मैं चाहता हूँ कि मेरा पैटर्न दूसरी पंक्ति से मेल करे, न कि पहले पंक्ति। मूलतः जहां भी some_text_i_want, एक ,

के साथ पूर्व में नहीं है

कैसे के बारे में:

  \ ([^,] \ | ^ \) \ s * some_text_i_want  

?

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


unix - Howto pipe raw PCM-Data from /dev/ttyUSB0 to soundcard? -


I am currently working on a small microphone, connected to a PC via a FPG. FPGA creates a raw datastream through UART / USB in my computer. I am capable of recording, playing and analyzing data.

But I can not run "live" audio stream directly

What is the datastream saved in PCM raw - format with a custom built C program, and piping the contents of the file into aplay. But it adds 10 seconds lag to theststream ... not very good for demoing or testing.

  tail -f snd.raw | Aplay -t raw -f S16_LE -r 9000 Do anyone have another idea, how does audio stream get faster in my ears? Why does  
  cat / dev / ttyUSB0 | Aplay  

Not working?

You need one API that lets you stream the audio directly into the sound card. I did not do it on Linux, But I have used it for this purpose. You can get another API in the SDL seems popular

The general idea is that you set up a streaming buffer, then your C program removes the bytes coming in a byte. In the coming stream the shape is chosen to balance the gap with jitter. When the array is complete, you pass it in the API, and start filling the second while doing the first drama.


c# - How to check programmatically if a type is a struct or a class? -


यदि एक प्रकार एक स्ट्रेट या वर्ग है, तो प्रोग्राम को कैसे जांचें?

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

का प्रयोग करें:

यह एक मूल्य इंगित करता है कि टाइप एक मान प्रकार है।

< पी> या तो इस तरह का प्रयोग करें:

  typeof (Foo) .इसवल्यूए टाइप  

या इस तरह निष्पादन समय पर:

 < कोड> फू इंस्टेंस। गेटटाइप ()। आईएसवैल्यू टाइप  

इसके विपरीत, एक संपत्ति भी है (जिसे आइररिफर टाइप मेरी राय में, लेकिन कोई बात नहीं कहा जाना चाहिए था) जो आपके परीक्षण के लिए परीक्षण के आधार पर आपके उपयोग के लिए अधिक उपयुक्त हो या हो सकता है।

कोड हमेशा बूलियन निगमन के बिना बेहतर पढ़ता है, इसलिए जो भी आपके कोड की पठनीयता में मदद करता है, उसका उपयोग करें।


जैसा कि स्टीफन नीचे की ओर इंगित करता है, ठीक से उसकी पहचान करने के लिए स्ट्रैक्टस आपको enum की बात करते समय झूठी सकारात्मकता से बचने के लिए सावधान रहना चाहिए। एक enum एक मान का प्रकार है, इसलिए IsValueType संपत्ति true के लिए enums और structs वापस आ जाएगी

अतः यदि आप वास्तव में structs की तलाश में हैं और न सिर्फ सामान्य मानों के लिए आपको ऐसा करना होगा:

  प्रकार fooType = fooInstance .GetType (); बूलियन isstruct = fooType.IsValueType और amp; amp; ! FooType.IsEnum;  

Haskell typeclass -


I have a Haskell type class question. I can not fortify the syntax to get this (appropriately appropriate) program to compile under GHC.

  import control. Concurrent Merv Blah 1 :: [A] - & gt; Io ([A]) blah1 = return blah2 :: [A] - & gt; Io (MVR [A]) blah2 = new MVR class blows where blah :: [A] - & gt; IO (BA) Example Blow [] Where blah = blah1 - Boom Example Blah (MVar []) where blah = blah2 main :: IO () main = dot STRLN "OK"  

The following error message gets, what kind of meaning, but I do not know how to fix it:

  `[] 'is not applicable to the adequate type arguments expected type` *', but `` Like `` - - & gt; In the declared declaration for 'Blah (MVR [])' in type 'MVR []',  

Whatever you want is not clearly obvious. This is probably nearly as close to what you will get:

  New type MVirlist A = MVR [A] Installation Blah Mavirlist where Blah = FMAP MVIRLIST NewMVar  

c# - How do I make a textbox update as an event happens not when the code has finished? -


  निजी शून्य डिस्कग्स_नईस्टाटस संदेश (ऑब्जेक्ट प्रेषक, न्यूस्टैटस संदेश एवेन्टअर्ज ई) {textBox1.Text + = e.Message () + " \ r \ n "; }  

मेरे पास मेरे प्रपत्र पर उपरोक्त ईवेंट हैंडलर है और मैं प्रगति दिखाने के लिए कक्षा में कोड के विभिन्न बिंदुओं पर होने वाले संदेश दिखाने के लिए प्रपत्र पर एक टेक्स्टबॉक्स अपडेट करने की कोशिश कर रहा हूं।

सभी संदेश टेक्स्ट बॉक्स पर दिखाई देते हैं, लेकिन जब तक क्लास कोड समाप्त नहीं हो जाता तब तक नहीं होता है।

मैं क्या कर रहा हूं?

आपको पाठ बॉक्स को रीफ़्रेश करने की कोशिश करनी चाहिए, ताकि यूआई परिवर्तनों के साथ अपडेट हो।


c# - Why should I write CLS compliant code? -


I have found a lot of pages about CLS compliance.

I understand that CLS compliance:

Many PayPal writes that "if If you write the code, then you should write it a CLS compliant. " But as far as I can read, there is no reason to use CLS compliance in generic software.

Am I right or have I missed something?

If you write a library or framework, it is understandable to make sure that your The library can be used in any CLR language.


.net - How to store custom settings for a WCF service? -


  1. People say libraries should not be a configuration file.
  2. I can not pass arguments with my host of its WCF service class (but I can do it with the customer).
  3. I do not want to store the configuration on the client.
  4. What should I do?

What are you asking? Are you talking about the settings for the service (server side), or the client?

Why can not you just use the client-side config file as if you do for other apps? This is the underlying, preferred way of doing things - why not use it ??

Then: What exactly are you asking for? Or what's the problem, are you trying to solve, actually?

  • For a service (server side): Store your binding, behavior, service endpoint etc. Web.config (if hosting in IIS) or your service host (if the NT service Or console app) then

  • For the client: Store your configuration The main app's app. If you want, configure the "client.config" and "bindings.config" files you can provide, and then just simply

      & lt; System.serviceModel & gt; & Lt; Bindings configSource = "bindings.config" /> & Lt; Client configSource = "client.config" / & gt; & Lt; /system.serviceModel>  

Your Client App's App In fact - in fact, this is not so much easier!


Dynamically Create Arrays in Ruby -


Is there a way to dynamically create an array in Ruby? For example, suppose I want to loop through the array of a book as a user input:

books = gets.chomp

User input:

  "The Great Gatesby, Crime and Punishment, Dracula, Fahrenheit 451, Pride and Prejudice, Sense and Sensibility, Slashhouse-Five, Adventures of Hucklebury Finn"  

I change it to an array:

  books_array = books.split (",")  

Now, Everybody User input for a book, I want to make Ruby to make an array. To do this, pseudo-code:

  x = 0 books_your counts.times do x + = 1 puts "Please weekly sales of # book_ar [x]} separated by commas. " Weekly_sali = gets.chomp.split (",") end  

Obviously this does not work. It will only define weekly_seal again and again . What is the method of creating a new array with each loop of the Times?

  weekly_sale = {} puts 'a list of books' book_list = gets Chomp books = book_list.split (',') books.each do | Book | Say, "Please input the weekly sales of # {book}, separated by commas." Weekly_sales [book] = gets.chomp.split (',') End  

In Ruby, there is a concept of a hash, which is a key / value pair. In this case, Weekly_sali hash is, we are using book names as keys, and value as array.

Instead of doing a small change in your code, instead of doing books, counts.times to define loop and then to define the array array elements with counter, through each collection to be repeated There is a very good way.


grep - Find lines containing all keywords in bash script -


मूलतः, मुझे ऐसा कुछ चाहिए जो इसी तरह से व्यवहार करता है:

  cat file | Grep -i keyword1 | Grep -i कीवर्ड 2 | Grep -i keyword3  

मैं ऐसा कैसे कर सकता हूँ एक बास स्क्रिप्ट जो कि खोजशब्द तर्कों की एक चर-लंबाई सूची लेता है? स्क्रिप्ट को सभी खोजशब्दों वाली पंक्तियों के एक केस-असंवेदनशील मिलान करना चाहिए।

इसे एक स्क्रिप्ट के रूप में प्रयोग करें < / P>

  #! P = "$ P && / $ k /" / bin / bash awk -v IGNORECASE = 1 -f & lt; (पी =; के लिए k; करो [-z "$ P"] && P = "/ $ k /" ";" P $ प्रिंट {प्रिंट} ")  

और इसे

  script.sh keyword1 keyword2 keyword3 & lt; फ़ाइल  

.net - why is use of "new NetworkCredential(username, password)" not working for Basic Authentication to my website (from a WinForms C# app)? -


I have a website that uses basic authentication (username / password).

Why is the following code not working? When I run it, the web application takes me to the login controller, while I hope that it should already be authenticated. I am populating credentials. In other words, I am trying to confirm that, in .NET, I Confirm my winforms HttpWebRequest so that it can automate the authentication process. I'm assuming that the network is the credential .net class that should do this? Or ntc What is the hope that some manual two step process do you have to implement yourself?

Here's the code:

  // Create a new web search for the specified URL. Var uri = new Uri ("http://10.1.1.102:3000/ download / escass"); Var myWebRequest = (HttpWebRequest) WebRequest.Create (Yuri); MyWebRequest.PreAuthenticate = true; Var NetworkCreative = New network credentials ("test", "asdfasdf"); MyWebRequest.Credentials = networkCredential; Var myWebResponse = (HttpWebResponse) myWebRequest.GetResponse (); Console.aut Type ("position =" + myWebResponse.StatusCode); Var stream = myWebResponse.GetResponseStream (); Var reader = new streamrider (stream); String text_read = reader.ReadToEnd (); Console.WriteLine (text_read); DisplayHtml (text_read); Reader.Close (); Stream.Close (); MyWebResponse.Close ();  

thanks

WebRequest Do not send credentials unless challenged by the site. The site should first respond with a "code-WWW-authentication header with 401 'authentication required'; Respond to the challenge with WebRequest credentials, and the service must respond with 200 HTP content.

It seems as if the site does not apply basic ath properly (imagine that first of all, the challenge should be passed in the field), which is a very common behavior you WebRequest Headers can integrate the original authentication from the collection, which most developers are doing anyway.

View


c# - Locking issues with replacing files on a website -


I want to replace existing files with an updated version of an IIS website. Say these files are large PDF documents, which can be accessed through hyperlinks. The site is up to 24x7, so I'm concerned about locking problems when a file is being updated at the same time, when someone is trying to read the file.

The files are updated on the server using the C # code running. I can think of two options to open the file to write.

Option 1) Open the file to write using FileShare. Read:

 using  (file stream stream = new file stream (path, file mod. Creat, filex, fileshore. If this file is open, and a user through a hyperlink In the web browser, requesting the same file to read, the document opens as a blank page.  

Option 2) Open the file to write using the fileshare.NONE: Using

  (File streams) Rim = new filestream (Path, FileMode.Create, FileAccess.Write, FileShare .No))  

Although this file is open, and a user accesses a web browser through a hyperlink In the same file requests to read, the browser shows an error In IE 8, you get HTTP 500, "Can not display website page", and in Firefox 3.5, you get: "Process file Can not access because it is second The process is being used by the process. "

The nature of the browser behavior is understandable and it looks reasonable. I suppose it is not highly likely that a user is attempting to read a file at the same time What you are updating it It would be good that in some way, the file update was atomic, like updating a database with SQL wrapped around a transaction.

I am thinking that you guys worry about such things, and the options given above to update the files, or you have other options too

< / Div>

How to copy the new version of the file with a different name and then the overwritten argument true < / Em>? When you are writing this, you will not interfere with the web server and will be quick to move the file.


errno - What does this error mean? - httperf: connection failed with unexpected error 105 -


Does anyone know what this is a simple error? Does this have a negative effect on my tests?

  httperf: Connection failed with unexpected error 105  

< P> Numeric error code is an error with value when error 105 (ENOBUFS) occurs, that means no buffer space is available. Ie, buy more RAM or reduce the maximum size of buffers for TCP sockets.

To know the meaning of the error code, I did:

  grep 105 / usr / contains / * / * error *  
< P> has given me:

  /usr/include/asm-generic/errno.h:#define ENOBUFS 105 / * No buffer space available * /  

If you search for eobuf, then there may be more details in Wikipedia.


OOP - How to choose a possible object candidate? -


I worry about what technology I should use to choose the right object in OP

< P> Is there any book needed to read about the way to select objects?

"

  • Just write something Whatever work is done, even if it is ugly, continuous refactor:

    • end ()
    • increase
    • reduce

    But:

    • Do not engage more;
    • do not write stuff

    This is an exact There is no prescription, just continue to practice some general guidelines.

    PS

    Code objects are not related to solid real life objects; They are lying.

Html>

Should I have to merge and commit every time I update my Mercurial branch on the production server? -


I am using Mercurial in a recent project. I am deploying this project on the web server where I have a slightly different config file with the output settings. The problem is that when I do pull and update There is also often merge and commit .

Is this the correct workflow? It seems odd that in order to be able to continue the update, I have to complete the changes, I felt that a merge integrates them into my production branch and every time I update it. Is this a distributed version control paradigm that I'm not using yet?

It was handled in a way, but I think your question is better that a bit more There is clarity.

In short: Yes, this is normal. Here's a part of expanse:

You start with this in the main repository (where the box changes):

  Main: - [E] - [F] - [g]  

Then you clone the production server and add a change, h, which is the deployment Optimizes. So the deployment repo looks like this:

  Product: - [e] - [f] - [g] - [h]  

and then the main There is more work on the repo, adding changes, I and J, are seen as main repos:

-
- [e] - [f] - [g] - [i ] - [J]

When it is drawn into production it looks like this:

  Product: - [E] - [F] - [G ] - [ii] - [ja] \ \ - [h]  

with two heads, which you meet:

  Product: - [ E] - [F] - [H] ] - [ii] - [ja] \ \ - [h] ----- [k]  

Where's just J plus, the changes you made in H .

Now more work is done in the main, give:

  main: - [e] - [f] - [g] - [ii] - [j] - [L] - [M]  

To give output to you:

  Production: - [E] - [F] - [g] - [ii] - [ja] - [l] - [m] \ \ - [h] ----- [k]  

And then you merge and get:

  Production: - [e] - [f] - [g] - [ii] - [ja] - [l] - [m] \ \ - [h] --- - [K] ------- [n]  

So every time you bring changes from the main, you are doing a merge, and a new change ( This b NAR N).

I think this is fine, and this is "normal".

You can avoid it by answering some of the questions associated with the above questions. And A new trick is you parents (and material) of the original H. Can be used to keep modify so that it can always be taken to the end of the new tip.

This is a trick and it will generate linear history on production (although you are still doing this which is essentially a merge to get it). I am not a fan because I do not like to change the changes after being committed, but since H never leaves the production box.

There were other answers and (as host: Header).


c# - Full text search on a bound DataGridView control -


I can not find a way to fully search a full text search on the datagrid view control across the breathtaking column Rows.

The Datatelle and the DataWish object seems to force me through search for specific columns either through selection (), Find (), or FinePro (). With DataGridView control only

I have a search string and I need to run it against the whole contents of DataGridView. I'm sure the answer is somewhere nearby but I think that I am currently at C # and Can not be able to get it in my attachment in Net Framework.


This is my current solution that I would like to save:

  / * ... for (int i = found_listo + 1; i & lt; datagrid RES. ROS; number; ++ I) {For (J. J. L. L. Datagrid race column.math; j ++) {if (datagridRes.Rows [i] .seel [j] Value .toString (). Includes (search_last_strack.)) {DataGridRes.Rows [i]. Selected = true; Datagreat Reese First displaycrollingRoundEx = I; Found_last_row = i; break; }}} / * ... * /  

I think that's the common approach Search the source data (not the grid), then only show matches If you use paging, the grid data pulls the data from the page from the database to the database, so you should only be looking for the page you are currently viewing.


IPhone SDK - Passing Variables between views with animations -


Hello I'm new to iPhoneSDK so please take a break with me.

What I basically have is a scene with 10 buttons, whose name is respectively 'one' and 'ten'. What do I want to do when I click on a button (like: 'nine'), then it goes to the second scene with animation, then on that next scene, there is a label that will display the text of which I clicked on the first button (like: I pressed the label 'nine' button on the next page, label 'nine')

If this problem is not high, it will be greatly appreciated that your How each idea works Like Chci.

I basically have my code but it is definitely confusing and false

Conceptually, whatever I tried and learned so far is:

1) I tried animating and switching using ADSView, Add-Siewviews, SetInnation, etc. I managed to switch ideas, but I do not know how to pass the data.

2.) I've learned Push ViewControllers. From the tutorials I saw, I practiced on a hierarchy table. I came to know that there are only UIViewControllers and UITableViewControllers that can be pushed, I know how this applies if it is in a table, but I do not know how it applies to ideas (because in my app screen But buttons are randomly scattered)

If you can give me somehow what I am trying to do, even at least the step-by-step concept For, i I appreciate and thank you all for life. I am working on it for weeks and it is really not a real person to explain to me is difficult.

Please try to use the tag

Give a tag for the button (1 to 10) and when a button is clicked, get the sender's tag so you can know which button was clicked on. Please note, this is only necessary if you use the same method for all button clicks.

To display the next view controller, create a property (click button) type NSString and synthesize it. File.

After receiving the text in a variable based on the clicked button, create a new object of the view controller that appears (I think you already do this) and set the property Click clickedButton of this view controller object.

NewviewController * nController = [[NewviewConverterAloc] initWithNibName: @ "NewView"]; [Encryptor Setlight Button: yourStringVariableWithButtonName]; [[Self-Navigation Controller] Push ViewController: Animated Animator: Yes];

In the newview controller, set the text of the label on the clicked button

  [yourLabel setText: clicked buttons];  

Hope that helps.


gnuplot - Drawing gant-like diagram from file in C with boxes and axis -


I am the programming system in C and I would like to represent the data generated in rectangles in 2D plain with volume x and y (Scheduling problems). It should look like a gantt chart. Information is given in the text file. I do not need any fantasy yet "Colors ending in X = 5, Y = 3, X = 7, Y = 5, in color red" something like a box " Should support and I would like to create an image of any size.

Is there a good experience for any of your devices that can be used to generate such images from the command line Can ( From some files, maybe every line in the color XY XY format)?

So far, I see gnuplot as a viable solution.

Check GraphViz, in particular the dot actually wants the graph layout, but if the memory works well you can confirm it You can put it in the box in position. You can use dot from the command line Or plug in your API.

Or, you can consider writing SVG directly, it's just text - but does it work for you, depending on the last part depends on. Graphic in. Most browsers now have the proper removal of SVG in the proper execution.

In addition, you can see any of ImageMagic, Disneylin, Cairo or other graphics libraries.

So, GNUPlot is not possible to go a long way.


Are cross-domain favicons a security risk? -


I have a site of news articles presented by the user, and for a convenience I had an idea that favicon was targeted To display the site with links.

The functioning tool to grab the favicon will be checking the favicon.ico file on the target server. Will displaying that icon as an image open any hole? Can some kind of malicious favicon occur? Converting Image Server-Side to a Different File Format Is Dismissing Risk?

A vulnerability in the window a few years ago JPEG Parser It is possible that in future the weaknesses in other formats Can be searched, but I think you are very safe to display it, and if the threat is promoted then be cautious about patches.

However, to protect the privacy of your users, you should cache the favicon on your server, and take the user's browsers from there. On the other hand, some sites feel that you have violated your intellectual property by displaying your site on your favicon. Again, I probably do not worry much about it So they do not ask you to stop.


c++ - Is this "*ptr++ = *ptr + a" undefined behavior? -


OK, I'm not really serious about this answer, I'm just curious.

As the expressions of * ptr ++ = a are fully valid because we have two objects ptr and * ptr But if I write * ptr ++ = * Ptr + a is it still valid?

For example, consider the following snippet:

  int main (zero) {int a [] = {5,7,8,9,2}; Int * p = a; * P ++ = 76; / * Change the first element * / * p ++ = * p + 32; / * Change the second element * / p = a; Int i; For (i = 0; i <5; i ++) printf ("% d", * p ++); Return 0; }  

I think the expression * p ++ = * p + 32; There is nothing to worry about , but I am not sure about the sequence points involved in it. First assume that 'p' is an indicator type. Otherwise all operations are there. Sentinative Chinese for Function Calls

Allows us to break the statement into parts.

  int * p = a; * P ++ = * P + 32; & Lt; & Lt; Sequence Point & gt; & Gt; // Part 1: Definition of post growth in P ++ // standard (5.2.6) // The result of the expression is the value of p ++ 'p', whereas the value of the // object represented by 'P' 'It can be represented in its pseudo code: (A) Int * P1 = P; (B) P = P + 1; // Part 2: * P (on the result of Part 1) (on * P ++) (C) Int'l; P2 = * p1; // pay attention to the use of p1; // Part 3: * P (* at P +32) // Note: There is no connection between this part of 'P' and 'P', Part 1 and 2 (D) Int. P3 = * p; // Part 4: * P + 32; (E) int p5 = p3 + 32; Note the use of // p3; // Part 5: assignment. (F) P2 = P5; & Lt; & Lt; Sequence Point & gt; & Gt; The order should be protected: Before (B) (A) before (C) (D) before (E) (C) before (F) (E) (F)  

In view of the above obstacles:
compiler can order these instructions again in many ways, but the main point is that (b) can be anywhere (B) only The obstacle that happens is (A) after (A) according to the exact position of the value of P3 (B) defined in (D), in two different values One might.

As the value of p3 can not be defined here - as a result the statement has undefined behavior.


How do I get the values of the RecordSource in an Access combobox -


I have a form of access with a combobox.

Cumblocks gets through the displayed value RowSource select a SQL statement through the property that

Usually selected id_of_table is required; property is set to bound column 2. Therefore, I can access this value (after example in an update event) such as var_id_of_table = me.cbo whatever
which works without problems.

Now, sometimes, I just do not need id_of_table, but the value of col_foo is also not there. So, the question is, how would I have gone about this desired value? I thought I could get it in something like the var_foo = me.cboWhatever ("col_foo")
however this does not work.

I appreciate

You need it: < / P>

  var_foo = me.cboWhatever.column (n)  

Where n starts with 0 The column number is.


Eclipse: How to go to a error using only the keyboard (keyboard-shortcut)? -


Assume that I have a file with 10 lines and I have a problem with the package (or something) and cursor name text

What is the problem and what are the suggestions for removing the problem by using the shortcut

The question is: Do I have a keyboard shortcut for this ?

Windows and Linux

  • Go to next error: Ctrl + .
  • Go to the previous error: Ctrl + ,
  • Show quick correction: Ctrl + 1

Mac

  • Go to next error: < Kbd> CMD + .
  • Go to the previous error: CMD + ,
  • Show quick correction: CMD + 1

how to keep icons in listview in android? -


कैसे एंड्रॉइड में सूची दृश्य में माउस को रखें?

मुझे यकीन नहीं है कि मैं आपका प्रश्न समझता हूं। यदि आप सूची सूची में चित्र चाहते हैं तो आपको अपनी सूची आइटमों के लिए कस्टम लेआउट को परिभाषित करने की आवश्यकता होगी। आप उस लेआउट में एक छविदृश्य और उसके बाद अपने GetView या newView / bindView (एडेप्टर क्लास के आधार पर आप विस्तार कर सकते हैं) रख सकते हैं, आप छवि दृश्य को संशोधित कर सकते हैं ताकि आप जो भी ग्राफिक फिट देख सकें।


c# - Embed multiple icons in WPF EXE -


I have a WPF assembly in which I would like to embed five icons for different file types associated with my application. How can I embed these exchanges in my EXE?

@smoore @Groky @ChrisF, thanks. Unfortunately, this is not what I asked. I think my question was quite unclear 0_ ° Please repeat this question to me:


I have an icon, such as Application.ico , document.ico , etc projects in my WPF as a resource. I use these icons in most cases with the following cases:

  & lt; Image Source = "/ MyAssembly; Component / Resource / Icon / application.ico" />  

This works all the time I know.


What is my question, how can I use the same icon from Windows Explorer for file associations in the registry? I want to be able to use the icon with a path like this:

  c: \ program files \ MyApp \ MyApp.exe, 1  
< P> How the mouse is connected to the file type in HKEY_CLASSES_ROOT

AFAIK, I should use a resource file ( .rc ), compile it and import it to your EXE Some with lines:

  101 RT_ICON Application.ico 102 RT_ICON Document.ico // etc ...  

Is this the correct way in WPF? Is there any alternative, especially since this method gives birth to the extinction of the assembly from my assemblyInfo.cs I'm still ready to write version information in the resource instead of assembly information .

I got a solution ! This is not right, but this is what I want! As I used very long Scandinavian nights to find a solution, I think I have to share it here.

Here I have done that:

1) Writes a dumb console to the C # app

  class ResTest {static void main () {System .Console.WriteLine ("Hello World!"); }}  

2) A simple csc restest.cs to test my code.

3) Notepad opened and I wrote a app in a file. RC was dubbed. "icon" V. App.rc , the.

5) Reuters csc but this time:

  csc is a new file,  app. /win32res:App.res restest.cs  

6) restest.exe now had an icon with 101 ID and I could get two other icons in Xialis Iconworkshop


Now, I found that my assembly information (version, product name, blah blah blah ) disappeared. I googled VS_VERSION_INFO and came to the MSDN article about the VERSIONINFO structure which defines the characteristics I need in RC files.

I would prefer more 'automated' method, but I want to use C # Express and Windows Vista SDK.

- Hope you can use it ...


c# - Why does this work? Method overloading + method overriding + polymorphism -


निम्न कोड में:

  सार्वजनिक सार वर्ग MyClass {सार्वजनिक सार bool MyMethod (डेटाबेस डेटाबेस, संपत्ति परिसंपत्ति, रेफरी स्ट्रिंग त्रुटि संदेश); } सार्वजनिक सील कक्षा MySubClass: MyClass {सार्वजनिक ओवरराइड बूल माइमथिप (डेटाबेस डेटाबेस, एसेटडेटेड परिसंपत्ति, रेफरी स्ट्रिंग त्रुटि संदेश) {MyMethod (डेटाबेस, परिसंपत्ति, रेफरी त्रुटि संदेश); } सार्वजनिक बूल माइमथिप (डेटाबेस डेटाबेस, एसेटबेस परिसंपत्ति, रेफरी स्ट्रिंग त्रुटि संदेश) {// काम यहां किया जाता है}}  

जहां एसेट डिटेल्स एसेटबेज का उपवर्ग है।

सी # आपके अन्य कार्यान्वयन के लिए आपकी कॉल को हल करेगा क्योंकि किसी ऑब्जेक्ट पर एक विधि को कॉल करता है, जहां उस ऑब्जेक्ट के लिए क्लास का अपना कार्यान्वयन अधिसूचित या विरासत में मिला है।

यह सूक्ष्म और कठोर-से-ढूँढें समस्याओं का कारण बन सकता है, जैसे कि आपने यहां दिखाया है। उदाहरण के लिए, इस कोड की कोशिश करें (पहले इसे पढ़िए, फिर संकलन करें और इसे निष्पादित करें) देखें कि यह क्या होता है आप इसे करने की अपेक्षा करते हैं।

  सिस्टम का उपयोग कर; नामस्थान कंसोल अनुप्रयोग 9 {सार्वजनिक वर्ग आधार {सार्वजनिक वर्चुअल शून्य टेस्ट (स्ट्रिंग) {Console.Out.WriteLine ("Base.Test (स्ट्रिंग =" + एस + ")"); }} पब्लिक क्लास वंशज: बेस {सार्वजनिक ओवरराइड शून्य टेस्ट (स्ट्रिंग्स) {Console.Out.WriteLine ("Descendant.Test (String =" + s + ")"); } सार्वजनिक शून्य टेस्ट (ऑब्जेक्ट्स) {Console.Out.WriteLine ("Descendant.Test (वस्तु =" + s + ")"); }} वर्ग कार्यक्रम {स्थैतिक शून्य मुख्य (स्ट्रिंग [] आर्ग्स) {Descendant d = new Descendant (); d.Test ( "टेस्ट"); Console.In.ReadLine (); }}}  

ध्यान दें कि यदि आप वेरिएबल के प्रकार को Base के बजाय Descendant के घोषित करते हैं, कॉल दूसरी विधि पर जाएं, इस रेखा को बदलने का प्रयास करें:

  Descendant d = new Descendant ();  

इसे करने के लिए, और पुन: चलाने:

  बेस d = नया वंशज ();  

तो, आप वास्तव में Descendant.Test (String) कॉल करने के लिए कैसे प्रबंधित करेंगे

मेरा पहला प्रयास इस तरह दिखता है: < / P>

  सार्वजनिक शून्य टेस्ट (ऑब्जेक्ट्स) {Console.Out.WriteLine ("Descendant.Test (ऑब्जेक्ट =" + s + ")"); टेस्ट ((स्ट्रिंग) रों); }  

यह मेरे लिए कोई अच्छा नहीं था, और इसके बजाय बस एक अंतिम स्टैक अतिप्रवाह के लिए टेस्ट (ऑब्जेक्ट) कहा जाता है।

लेकिन , निम्न कार्य करता है चूंकि, जब हम d चर को बेस प्रकार के होने के लिए घोषित करते हैं, तो हम सही आभासी पद्धति को बुलाते हैं, हम उस चाल को भी सहारा सकते हैं:

<पूर्व> सार्वजनिक शून्य टेस्ट (ऑब्जेक्ट्स) {Console.Out.WriteLine ("Descendant.Test (ऑब्जेक्ट =" + s + ")"); बेस बी = यह; b.Test ((स्ट्रिंग) रों); }

यह प्रिंट होगा:

  Descendant.Test (ऑब्जेक्ट = टेस्ट) Descendant.Test (स्ट्रिंग = टेस्ट)  

आप भी बाहर से ऐसा कर सकते हैं:

  Descendant d = new Descendant (); d.Test ( "टेस्ट"); बेस बी = डी; b.Test ( "टेस्ट"); Console.In.ReadLine ();  

प्रिंट होगा।

लेकिन पहले आपको इस समस्या से अवगत होने की आवश्यकता है , जो एक और बात पूरी तरह से है।


Java Stanford NLP: Part of Speech labels? -


The Stanford NLP demo gives an output like this:

  Colorless / JJ Green / JJ thoughts / NNS sleep / VBP badly / RB ./  

What part of the speech tag mean? I can not find an official list, is it Stanford's own system, or are they using the universal tag? (For example, what is j j ?)

Besides, when I'm walking through sentences again, for example, looking for the nouns, let me Something like checking the view is .contains ('N') . It looks very weak, is there a better way to programmatically search for a better speech?

Look at PS

JJ is adjective. The NNS noun, plural is the current tension of the VBP verb is R.B. adverb.

It is for English, for Chinese, this pen is Chinese treebank

  • CD cardinal number
  • DT assessor
  • JJ Adjectives
  • J.J. Adjective
  • FJ foreign word
  • j js, adjective, redundancy
  • ls list item marker
  • MD modal
  • NN note, singular or collective
  • NNS Now, plural
  • NONP proper noun, singular
  • NNPS proper noun, plural
  • PDT preorderer
  • POS Kosasi end
  • PRP personal pronoun
  • PRP $ scandalous pronoun
  • RB Edwards
  • RBR Advisor, T
  • > VB Verb, base form
  • VBD verb, previous tension
  • VBG verb, warrant or current particle
  • VBN verb, previous participle
  • VBP Verb, Non 3 Word Person Fantastic Present
  • VBZ Verb, Third Person Singular Present
  • WDT WideMarmner
  • WP Whpronoun
  • WP $ Harmful whpronoun
  • WRB Whadverb

  • sql server - SQL Query Designer -


    I'm wondering what is the best (free favorite) SQL Query Designer tool for Windows Vista?

    I am looking to create very complicated inserts and updates that include etc. And as a SQL beginner, I want to use a tool to help me design my questions a bit faster. .

    Thanks

    This one: Microsoft SQL Server Management Studio Express


    php - how to pass variables inside one page -


    I want to know how to pass the variable from a form to a php page.

    Thank you.

    Edit:

    I have some input and a submit button. I want to find my php page database and click on submit button and want to display a relevant table. And here all the actions are in one page.

    So I want to know how to move the variable from one page to a php script on one page. I apologize for leaving too few details.

    Can you understand my question now? Thanks again.

    Edit: In this way you enter a user-entered value from a form on the PHP page can do.

    Here's a general form:

       

    For PHP codes now:

      & lt; Php $ name = $ _POST ["name"]; ? & Gt;  

    Note: You can change the post type between POST and GET and change the ARP option to send form input on a different PHP page.


    Are you talking about passing a variable in the function?

      $ name = 'Robert'; PrintName ($ name); Function printName ($ n) {echo $ n; }  

    ios - Detecting selected cell using SWTableViewCell -


    I have applied the SWTableView class from

    I

    This is working fine, but I do not know How to get value when clicking on cell objects when exposed buttons

    This is how I perceive object on cellForRowAtIndexPath method:

      NSString * date = [self stringValueOfDictionaryObject: (ID) [[Historical fielding objectindex: indexpath.ro] valueify: @ "date"]];  

    I have added three buttons that show how the user swipe the cell. To add the button I need, to get the value of the selected row object. Mainly, when I need to retrieve the click string date on the button "more"

    it has the DidTriggerRightUtilityButtonWithIndex method

      - (zero) swipeableTableViewCell:. (SWTableViewCell *) cell didTriggerRightUtilityButtonWithIndex: (NSInteger) index {switch (index) {case 0: {// more button is pressed UIActionSheet * shareActionSheet = [[UIActionSheet alloc] initWithTitle: @ "Share" Representative: cancelButtonTitle zero: @ "Cancel" DestructiveButtonTitle: Zero OtherButtonTitles: @ "Share on Facebook", @ "Share on Twitter", Zero]; [Share Action Sheet Show Inview: Self. Weave]; [Cell hide failures] break; } Case 1: {// other button is pressed UIActionSheet * shareActionSheet = [[UIActionSheet alloc] initWithTitle: @ "Share" Representative: cancelButtonTitle zero: otherButtonTitles zero: "Cancel" destructiveButtonTitle @ "Share on Facebook", @ "Share on twitter", zero]; [Share Action Sheet Show Inview: Self. Weave]; [Cell hide failures] break; } Case 2: {// Delete button is pressed NSIndexPath * cellIndexPath = [self.tableView indexPathForCell: cell]; [Self.tableView deleteRowsAtIndexPaths: @ [cellIndexPath] withRowAnimation: UITableViewRowAnimationLeft]; break; } Default: Break; }}  

    I have solved it like this:

      NSLog (@ "INDEXPATH =% @", [self stringVoloxoxbox object: (ID) [[Historical Services ObjectIndex: Cellindexpath.ro]  

    I now retrieve an object value from the selected row I can ...


    php - Setting Excel file permission when creating file through PHPExcel -


    In my site, I am generating reports (custom code) in an Excel format. What happens is that it creates an Excel file in one place and then the user is supposed to download it through a link.

    The problem is that this file is being created with permission of 600, which means that the user is unable to download it. Is there any way in which 644 (or more) can be allowed?

    The code is below ...

    Code: -

      $ objWriter = PHPExcel_IOFactory :: createWriter ($ objPHPExcel, 'Excel 2007'); $ ObjWriter- & gt; SetIncludeCharts (TRUE); $ Tosave = str_replace ("customfunctions.php", "/ files / customfunctions.php", __FILE__); $ ObjWriter- & gt; Save (str_replace ('.php', '.xlsx', $ tosave));  

    PHPExcel will not change permissions, it will only create the file and save. If you want to set permissions for anything other than the default, then you can use it to do this.

    Example: chmod ("/ somedir / somefile.xls", 0644);


    javascript - Express & Casper: Can't set headers after they are sent -


    After

    I can not set a headers after they are sent error when the escape After posting on the URL, try the driver for a (CasperJS) script. I have received many other posts about this issue with people running with XPE and have to send headers several times more goods. I just can not believe that this is related to how I am doing here. To send the request status, I have to do res.send , right? Because if I do not have it, do not post the form.

    Any ideas what I am doing wrong here?

      app.post ('request' function (request, resolution) {// send callback res.send (req.status) (Verbose: true, LogLevel: 'debug', userAgent: 'Mozinta / 5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit / 537.22 (KHTML, like Lizard) Chrome / 25.0.1364.172 Safari / 537.22', PageSettings: {loadImages: false, loadPlugins: false}}); spooky.start ('http: //google.com', function () {this.echo (this.getTitle ());}); // Run scary Spooky.run ();});  itemprop = "text"> 

    error "error: can not set the header after they are sent to

    . " means that you are already in body or Finnish state and there is something that is trying to write the header.

    You have this res.send (req.status)); At the beginning of the callback and after that you are trying to do some more operations which are trying to set a header or status code but the body has already been written. So you see this error.

    You should finally send the answer, more importantly, try to understand the asynchronous behavior of node.js.

    move res.send (Req.status); For the last line of the callback, your code will work.


    Jenkins Git SSH keys on Windows slave -


    We currently have a Jenkins master on Windows, a Ubuntu slave, and a Windows slave I installed GIT on Windows slave I am trying to install Msysgit, and I include the directory in the system path variable so that I can call "git.exe" or "git.cmd" anywhere.

    In my Jenkins configuration, I have a credentials Personal Ssh Key This credential is to experiment with Git with Jenkins. It works on Master Node and Linux slave. I did not put a personal SSP key on those two servers, Jenkins handled it for me.

    But Windows slaves, not so much when I run a job on windows slave, I get all this error: error in cloning remote repo 'root' .

    Can I work on credentials on Windows Slave? Or, if you think this is not a problem, then what will be my next troubleshooting step?

    If you have seen any other message after this error, should you include them Can you update your question?

    Without seeing them, I only suspect that your Windows Gat .ssh folder (this folder contains your keys)

    Have you already seen the notes?


    ruby on rails - How to deal with API raises in general but more specifically from Twitter -


    So I'm really new to this thing, which are errors that can increase the API,

    For example, I am using Twitter GEM, and if I want to like the tweet, then delete my page in tweet and I get 500 and I get it:

      ActionView :: Template :: Error (No status was found with that ID.)  

    What I'm thinking is that I How to write codes, which can deal with these errors, say that I give an array of 2 aids, where the first does not work and the second is not. Ideally I want to leave it one before, though with the current situation all this will be closed together.

    There is some problem that I can, but I'm not sure what it is called.

    Usually you will write something to handle the exception. An example would be:

      get started go_get_tweet Rescue Twitter :: BadRequest = & gt; E logger Terror e.message # ... to protect the code from envy: timeout error => E do_something_that_retries rescue = & gt; E logger Terror "..." end  

    In this really flawless example it will match with some specific exceptions and also for any person who you did not specify in the form of a catch is.


    java - Quirk with my text editor app and DocumentListener -


    I have a jetbedpad I add a tab based on an acceleration of a class (here known as textWrap) In which there is information for a JTextPane, I create a new example of the listener and pass it in the textWrap:

      tabEditorPane.addTab (filename, new text editor (New MyDocumentListener ... ..) .);  

    My document changes the listener tab when the file changes. It all looks fine until I kiss Do not try to load the existing file in a text tab. The listener registers the initial BufferedReader input and an asterisk. How can I do this?

    Is there a rule of thumb for this I know that after creating the text the listener can register, as the text file is loaded, but I have to see what the stack says.

    When you load the file, / P>

      MyTextPane.getEditorKit (). Read (...);  

    or any equivalent loading method. What you can do is replace this line with 4 steps:

    1. Remove or deactivate your document listener
    2. Load
    3. Remove the star
    4. Undo the document listener or reactivate.

    To do this, you can expand, for example, type your text pane and a load method which will take these 4 steps. Anyway, the object file will handle loading, it will require reference of your DocumentListener


    mapreduce - Mongodb map reduce result format changes -


    I am using Java API and call the following map command:

      MAP function () {emit ('nogroup', {endtime: this.endtime, _owner: this._owner}); } Reduce the Reduce function (key, value) {var res = 3426533531976; (Var i = 0; i & lt; values.length; i ++) {if (value [i] .endtime & lt; res and value [i] ._man == faucet) res = value [i ] .endtime; } Return Ridge; }  

    with this code

      string map = "function () {emit ('nogroup', {endtime: this.endtime, _owner: this ). _owner}); }"; Reduce string = "Reduce function (key, value) for {var res = 9426533531976; (var i = 0; i & lt; values.length; i ++) {if (value [i] .endtime & lt ; Res & amp; amp; and value [i] ._man == faucet) res = value [i] .endtime;} return ridge;} "; MapReduceCommand CMD = New MapReduceCommand (userdataCollection, map, less, blank, MapReduceCommand.OutputType.INLINE, blank); MapReduceOutput Out = userdataCollection.mapReduce (cmd);  

    Sometimes results appear

      {"_id": "nogroup", "value": {"floatApprox": 1.426628475177E12}} < / Code> 

    and sometimes like it

      {"_id": "nogroup", "value": 9.426533531976E12}  

    How can I always remove my long results with the same code?

    I currently have

     for  (DBObject a: out.results ()) {return ((BasicBobject) a.get ("value")). Mill Long ("FloatProoprox"); }  

    but it only works for the floatApprox version

    Just add a check after:

      res = value [i] .endtime;  

    For example.

      res = value [i] .endtime; If (type res == "object") {res = res.floatApprox; }  

    c# - How do you configure the DbContext when creating Migrations in Entity Framework 7? -


    Dependency injection can be configured when using the migration command of the entity framework?

    The unit framework 7 supports dependency injection for the subdivision of DbContext This mechanism includes permission to configure data access outside of DbContext . For example, to configure EF for a SQL server in the following, config.json

      servicon services = ... var configuration = new configuration () . AddJsonFile ("config.json"); Services.AddEntityFramework (Configuration) AddSqlServer () .AddDbContext & lt; Billing DBcinTex & gt; (Config = & gt; config.UseSqlServer ());  

    However, the migration commands do not know to execute this code, so the ad-migration will fail due to lack of provider or lack of connection string .

    Migration can be done to work by overriding OnConfiguring within the DbContext subclass to specify the provider and configuration string, but this It happens when different configurations go elsewhere and eventually my migration command and both of my code becomes extremely complicated.

    Note: My DbContext remains in a separate assembly from the entry point which uses it and my solution is multiple start-up projects.

    Note that this functionality does not yet exist in the unit framework 7. It is unavailable functionality,

    In the mean time, I got the easy solution to use global position rather than trouble with sub-clinging, generally my first design is not like but it's good for now Works the way.

    In MyDbContext:

      public static boolMigration = true; Protected override zero on-configuration (DBContext option builder option builder) {// TODO: This is dirty, but it is necessary for migration. // see https://github.com/aspnet/EntityFramework/issues/639 if (isMigration) {optionsBuilder.UseSqlServer ("& lt; your connection string here»;); }}  

    in startup. Configure Services () .

      Public IserviceProvider Configure Services {MyContext.isMigration = false; Var configuration = new configuration (). AddJsonFile ("config.json"); Services.AddEntityFramework (Configuration) AddSqlServer () .AddDbContext & lt; MyDbContext & gt; (Config = & gt; config.UseSqlServer ()); // ...}  

    (The configuration code actually stays in an autofac module in my case.)


    Photoshop Javascript: How to get / set current tool? -


    How can one get the current device using Javascript in Photoshop?

      #target Photoshop if (app curentTool == BRUSH_TOOL) {app.currentTool = ERASE_TOOL; } And {app.currentTool = BRUSH_TOOL; } I have found a solution, but I want it to be easy. Basically I'm using it to select brush tool and to toggle the eraser tool, using only one button. In this way I only have to use a button on my Wakom tablet.  
      #target photoshop if (getTool () == 'paintbrush') {set-to-handle ('erasaratul'); } Else {setTool ('paintbrushTool'); } // https://forums.adobe.com/thread/579195 function getTool () {var ref = new ActionReference (); Ref.putEnumerated (charIDToTypeID ("capp"), charIDToTypeID ("Ordn"), charIDToTypeID ("Trgt")); Var cTool = typeIDToStringID (executeActionGet (referee) .getEnumerationType (stringIDToTypeID ('tools'))); Return cTool; } // http://www.ps-scripts.com/bb/viewtopic.php?t=2179 Function Set Tools (Tools) {var desc9 = new ActionDiscriptor (); Var ref7 = new interference (); Ref7.putClass (app.stringIDTopeID (tool)); Desc9.putReference (app chirrupoted ('empty'), riff 7); Execution action (app childtotipid ('SLCT'), Days 9, Dialogmodes.No); } // moveTool // marqueeRectTool // marqueeSlingleRolTool // marqueeSingleColumnTool // lassoTool // polySelTool // magnetic losotil // quickceptol / / magic vantall // croptol // sliceol / slice / selected jokes / spot healing brush tools / / Jadustamptil / patch select / / redEyeTool // paintbrushTool // pencilTool // colorReplacementBrushTool // cloneStampTool // patternStampTool // historyBrushTool // artBrushTool // eraserTool // backgroundEraserTool // magicEraserTool // gradientTool // bucketTool // blurTool // sharpenTool // smudgeTool // dodgeTool // burnInTool // saturationTool // penTool // freeformPenTool // addKnotTool // deleteKnotTool // Knhwartconttail / type / Krenkr Type / writeTraglyTrolTall / /Cert masktool / / typeWriterCreativeMaskTall //SiteCompactSetTransactionTotal // DirectSetLol / /Itolol / GoalFoldAndLatall //EllipTestol // Multilanguage Toll / / LineTool / / CustomShowTool / / TextNet / VoiceAnotot / IDEP PerTool // colorSamplerTool // Rule Toll // Handtool // ZoomTel  

    java - HttpException: 500 when running a SPARQL query on remote endpoint -


    I am very new to semantic web programming. How to code java code to check SPARQL endpoint using Jena API Write, I'm learning about it.

    Here is my Java code:

      public class testJena {public static void main (string [] args) {string query string = "prefix owl:  

    When I run the query, I get the following exceptions:

      Exceptions to the thread "Main" HTTP Exception: 500 com. Hp. Hpl.jena.sparql.engine.http.httpQuery.rewrap (HttpQuery.java:414) com.hp.pl.jena.sparql.engine.http.Http on http://www.quite.co.uk (HttpQuery.java358) com.hp. On. HPL.jena.sparql.engine.http.HttpQuery.exec (httpQuery.javaociety95) at com.hp.hpl.jena.sparql.engine.http .QueryEngineHTTP.execResultSetInner (QueryEngineHTTP.java:346) com.hp. On. Hpl.jena.sparql.engine.http.QueryEngineHTTP.execSelect (QueryEngineHTTP.java:338) at com.TestJena .example.TestJena.Main (TestJena.java.3)  

    When I Run the above queries on overpoint http: // localhost: 8890 / sparql , it runs fine.

    Can anyone tell me where the problem is? Why is it throwing a HttpException: 500 ?

    Thank you! Closing point HTTP error code 500 (Internal Server Failure) Returning client code looks OK, probably

    An older version of Jena is running because it typically prints more details (if the remote end provides any).

    When you use it, there is probably an HTML form, not a SPARQL endpoint Additional parameters may be required - see the documentation of that server.


    java - Trouble retrieving data with JDBC in Eclipse IDE -


    I am quite new to Java, so I work on a project to develop my knowledge with database and Java I am here.

    I have come to know how to add questions to the database, but now I am getting errors in trying to print them.

    Assume that I already have everything that is scanner and SQL statement

    This is my connection class which is named Main Class:

      Public Static Connection Mill Connection () throws exceptions {String driver = "com.mysql.jdbc.Driver"; String url = "jdbc: mysql: // localhost: 3306 / testTable"; String user name = "placeholder"; String password = "placeholder"; Class.forName (driver); Connection Conn = Driver Manager.getConnection (URL, Username, Password); Return canon; }  

    Now in a different category if the user types! Search and a word I want to define the term that should be derived from the table with the name and column words, definition:

      string user search = user_input.next (); String [] userSearchSplit = userSearch.split ("", 3); If (userSearchSplit [0] .equals ("lookup")) {try {conn = MainClass.getConnection (); String query = "Choose the definition of the word in which the word =" + userSearchSplit [1]; Result result = pstmt.executeQuery (query); While (result.next ()) {string definition = result .getString ("definition"); Println (definition); }} Hold (exception e) {e.printStackTrace (); } Finally {try {pstmt.close (}}} Grip (SQLException e) {E.PintstacksTrace (); } Try {conn.close (); } Hold (SQLException e) {e.printstaxtrace (); }}}  

    When I try to find a word, then I put it on the table:

      java Lang.NullPointerException  

    Check if your user_input is empty or not?

    I am assuming your code:

      result result = pstmt.executeQuery (query);  

    As

      Description pstmt = conn.createStatement (); Result result = pstmt.executeQuery (query);  

    Or it may be that you have not started pstmt properly


    How do I AJAX post to an MVC action from within a javascript file? -


    The following code exists in the file

    job.js . When I run this code against local code, everything behaves properly. When I do against an intranet server where there is an application name, I get 404.

      Job.updateJob = function () {$ .post ('/ Builder / ListJobItems', function (info) {...}); }  

    I would love to use @ Url.Action () but as I said it is a javascript (.js) file. I know, where you put the data value on the body element, but for architectural reasons, I want to get this code decoupled from the DOM. This is a data acquisition engine, it should also know what a DOM is.

    I would be fine with a solution that parses window.location in some code, but the problem is that I need to have a solution that works everywhere Will do

    The reason for me being most disappointed is that I can not see how it will face every problem. Why is there no solution? Has everyone placed all their Javascript in Razor's view? Do not now separate the code in a module? I can not believe that none of these two are true, and yet there are no solutions coming to this. I am in loss.

    What do I do during the need of data from server side in JS files?

    I take action, and want to see with JS content. And instead job.js are also included

      & lt; Script type = "text / javascript" src = "@ Url.Action (" Job "," JSController ")" />  

    And I've set everyone in the view, like

      Job.updateJob = function () {$ .post ('@ Url.Action ( "ListJobItems", "Builder"), Function (Data) {...}); }  

    And it will work.


    jsf - Primefaces - Ajax commandButton -


    I have a problem, the way it is in the lower code, do not call it exampleController.include () Can anyone tell me what I am doing?

      & lt; H: form id = "exampleForm" & gt; & Lt; P: panel toggleable = "true" id = "pgInfo" & gt; & Lt; H: Panel Grid Column = "2" Cellpadding = "2" & gt; & Lt; P: input mask value = "" id = "val" /> & Lt; / H: panelGrid & gt; & Lt; H: Panel Grid Column = "3" CellPadding = "3" & gt; & Lt; P: Command button icon = "ui-icon-disk" value = "add" actionListener = "# {exampleController.include ()}" ajax = "true" update = "dataTable" process = "pgInfo" /> & Lt; / H: panelGrid & gt; & Lt; / P: Panel & gt; & Lt; P: panel toggleable = "true" id = "panelTable" & gt; & Lt; H: Panel Grid Column = "1" Cellpadding = "1" & gt; & Lt; P: datatable id = "datable" & gt; ... & lt; / P: Datatable & gt; & Lt; / H: panelGrid & gt; & Lt; / P: Panel & gt; & Lt; / H: form & gt;  


    java - Represent double as integer without regex -


    I am developing a calculator for android double field Has been given the name result , which I had inserted in a TextView

    if I say result = 20.0 It should be presented as 20 (without the point and a zero). If results = 20.0001 it should be displayed unchanged.

    Now I do with regular expressions but I think this is not a good idea. Is there another way of representing the double without any point and a zero if the double is actually an integer (without a point after the point)?

    Use (d% 1 == 0) { To check that your double is not a decimal part , then use intValue () integer to get the double method < / Code>

      class testDouble {public static zero main (string [] args) {double results = 20.001; If (result% 1 == 0) {System.out.println (the result can be changed in "integer, there is no decimal part"); } Else {System.out.println (Results + "can not be converted into integer, decimal part is"); } Results = 20.000; If (result% 1 == 0) {System.out.println (the result can be changed in "integer, there is no decimal part"); Int intOfDouble = result.intValue (); System.out.println (The result can be converted into "integer + intOfDouble);}}}  

      in 20.001 integer Can not be changed, decimal part can change to 20.0 integer, no decimal part is changed to 20.0 integer 20  

    sql server 2008 - Get the resultset of a function with sqlsrv and PHP -


    There is a function in my SQL Server 2008, which returns a resellet and some output variable.

    From PHP, I need to get value with sqlsrv library.

    I have this code, which I tested with a stored procedure and worked fine.

      & lt ;? Php $ serverName = "(local) \ MSSQLSERVER, 1433"; $ ConnectionInfo = array ("database" = & gt; "xxxx", "UID" => "xxxx", "PWD" => "xxxx"); $ Conn = sqlsrv_connect ($ serverName, $ connectionInfo); If (! $ Conn) {dead (;); } $ Tsql_callSP = "call {my_function (?,?)}"; $ Ret_cod = ""; $ Ret_desc = ""; $ Params = array (array ($ ret_cod, SQLSRV_PARAM_OUT), array ($ ret_desc, SQLSRV_PARAM_OUT)); $ Stmt = sqlsrv_query ($ conn, $ tsql_callSP, $ params); If ($ stmt === incorrect) {debug ("error in executing statement"); Die (debugs (sqlsrv_errors (), true)); } The error result is: 

    [microsoft] [odbc driver for SDC server 11] [sql server] 'my_function' for error message . 'My_function' is with a reluctant laugh

    I know there is a syntax error, but how do I do this? Find examples on the Internet.

    Try I,

    $ tsql_callSP = "? = {Call_my_function (?,?)}";

    / html>

    android - Send data over BLE with RFDuino -


    I have attached the sensor to RFDuno and want to send the readings to the BLE for the Android app. <

      const int censor pin = 2; Int sensor value = 0; Zero setup () {serial.begin (9600); RFduinoBLE.begin (); } Zero loop () {sensorValue = analogRead (sensor pins); Float voltage = sensor value * (3.3 / 1023.0); Serial. Print ("UV sensor ="); Serial.println (voltage); RFduinoBLE.sendFloat (voltage); Delay (1000); }  

    In the console I see values ​​like 0.2 . But in the app it translates something like 00-00-A4-41 but I do not find the logic behind it. How do I properly convert the value sent from RFDuino?

    RFduino floats in a little endian. Your Android app will receive it as 4 bytes, and in order to change the order of the bytes and change the float, you have to convert it to large endian. There are many threads on this topic, like And what you used to have

    It should be read immediately on the endearance and floating point format to understand the logic about it. But basically, the bytes in 4 byte float are stored in each other's reverse order in small vs. large endions. When you reverse 4 bytes in small bytes, then it becomes a big end and you're doing well to go for your situation.


    security - how can I track an online games result -


    We need to know the outcome of each match played in online games.

    We have 2 potential ways,

    1. TCP snifing: This game usually connects to the server (we do not have access to it). When the game is over, it sends information to the server.
    2. Logging in: It creates a log file as if it runs. When a user loses or wins, this information is found on the log file

    I want to remove this information. I can remove it well if a gamer wants to cheat, he can put the wrong information in the log file or make a dummy packet.

    How can I get authenticated game information here?

    For example, for "Age of Empires II" is a tracker from Vobila, when a single match is completed, the tracker collects all the information, how do they do it?

    Does your tracker work entirely on client machines? I believe this because you said that you do not have access to the server.

    There is no reliable way of tracking results on the client. Because, as you said, gamers can deceive or modify your tracker. Just gather the results and try to filter cheaters or bad results. In this way, you can not have an accurate score for each unique player, but you might be able to remove some useful statistics.


    ssas - Multiple Joins from one Dimension Table to single Fact table -


    I have an actual table in which 4 date columns have been created, log-date, active date and angiegred date. I have a dimension table named DimDate whose main key can be used as a foreign key for all 4 date columns in the facts table. So the model looks like this. Enter image details here

    But the problem is, when I want to sub-filtering For dates based on the Date column, for pre: Count all the users who were created in the last month and are engaged in this month. It is not possible to do this with this design, when I filter the measurements with creating a date, then I can not filter more for a different time window for the engagement date. Since all are connected to the same dimension, they are not working independently.

    However, if I create a separate date dimension table for each column, and thus join them, then it works. Enter image details here But when it is 20 different date columns in the actual table in the real world scenario, this is very It sounds cumbersome, where I have to make 20 different dimensions and add them one by one, is there any other way that I can achieve my scenario, in which many duplicated date dimensions can be created ? This concept is called a Role-Playing Dimension. You can tell the table to the DSV or the actual dimensions on each date. Do not add it once, add a date instead, then go to the Dimension Usage tab instead. Click Add Cube Dimension, and then select Date Dim. Right-click and rename it. Then update the relationship to use the correct areas

    There is someone covering this topic.