Posts

Showing posts from February, 2015

python - Iterating and modifying a dictionary -

I have a code in which the dictionary of the words is a dictionary, the meaning of the program is to merge the words. It is that if the word is the word in the word i , then the merge the value of the word [word i] Remove dictionary [word i] for i in word [word j] and my_dict.keys (): my_dict in Jammu .keys (): if i! = J: if i in j: my_dict [j] + = my_dict [i] del my_dict [i] elif j in: my_dict [i] + = my_dict [j] del my_dict [j] Is this code valid? Your code is not valid Do not place any command in Python to remove elements from the dictionary Delete is called del You can delete an item from the dictionary like this: del your_dictionary ['some_key'] Although this is not a great python you can refactor your code like this: for i_dict.keys () in: for j my_dict .keys (): if i! = J: if i in j: my_dict [j] = = my_dict.pop (i) in alif h i: my_dict [i] + = my_dict.pop (j) Pop> is a dictionary method, which returns and removes an item from ...

vba - Merging text from multiple cells into one cell -

I'm new to VBA and I'm trying to solve a small problem at work. How can I copy a string of A merged cells to some cells? Say that I have five cells from them: one two three four five Let me take these And with these words, a cell should be created below each other Like: sub-testing () String dim as the slow merged STR, later in cell range ("A1: A5") for each, as a boolean, if it merged later Then mergedStr = mergedStr & amp; Chr (10) mergedStr = mergedStr & amp; Cell.Value afterFirst = True Next cell range ("D3"). Value = mergedStr End Sub

ios - Generate mipmaped MTLTextures from AVFoundation camera stream -

I'm using AVFoundation to get the camera stream. I am using this code to get MTLTextures: Capture Capture (AVCaptureOutput *) capture Capture output: Sample buffer: (CMSampleBufferRef) connection to sampleBuffer: (AVCaptureConnection *) Connection {CVPixelBufferRef pixel buffer = CMSampleBufferGetImageBuffer (sampleBuffer); In the & lt; MTLTexture & gt; Texture = zero; {Size_t width = CVPixelBufferGetWidth (PixelBuffer); Size_t height = cvpxbuffergatehite (pixelbuffer); MTLPixelFormat Pixel Format = MTLPixelFormatBGRA8Unorm; CVMetalTextureRef MetalTextRep = Faucet; CVReturn POS = CVMetalTextureCacheCreateTextureFromImage (Zero, _textureCache, PixelBuffer, Zero, Pixel Format, Width, Height, 0, and Metal RFF); If (position == kCVReturnSuccess) {texture = CVMetalTextxtureGetTtexture (Metals Reflected); If (self.regulate) {[self-made texture: texture]; } CFRlim (Metal Tatifier); }} This works fine, except that the generated MTLtetexture is not a single object (only a m...

java - Spring MVC : Generating links which match the controller url pattern -

I'm writing a web app with Spring 4.0. I have written to my controllers who I believe, using the @RequestMapping annotation to define the URL pattern in general, which handles the controller. The snippet below shows a testimonial that displays a testimonial ... Somewhere else in my application, I want to generate a link bar which contains all the testimonials to join in my left hand. At this time, when I go to the link bar to create an href for the anchor element, I am hardening the URL such as: string href = " / Testimonial view / "+ testimonialname; This does not look right if I want to change the URL structure later, I have to convert it to at least two places - possibly more often, where the incoming URL matches the controller , And to create an anchor element once the user will click to invite that URL. What is the best way to deal with this problem? Should it be a normal, is it easy to use the constants to represent the URL and access them fro...

c# - "Could not load file or assembly 'PresentationUI.Aero2' or one of its dependencies." Why not? -

In my WPF application, I receive the following exception at startup: First chance exception 'System.IO.FileNotFoundException' contains additional information made in mscorlib.dll: File or Assembly did not load one of the 'Presentation UI.Aero2, Version = 4.0.0.0, Culture = Neutral, PublicKokon = 31bf3856ad364e35' or its dependencies Could go Edit: Using fusion log, I get a bit more valuable information than the call stack: LOG: DisplayName = PresentationUI. Aero2, Version = 4.0 1.0.0, Culture = Neutral, Public KeyConnect = 31bf3856ad364e35 (Full-Specified) LOG: Appbase = file: /// [...] / bin / debug / LOG: Initial PrivatePath = Null Log: Dynamic Base = Zero Log: Cache Base = Null Log: AppName = EngideskLauncher.vshost.exe Calling Assembly: Presentation Framework, Version = 4.0.0.0, Culture = Neutral, Public Key Token = 31bf3856ad364e35 === LOG: This bind starts in default load context. Login: Using the application configuration file: [...] \ bin \ debug \ Eng...

python - How to add inlines based on custom queryset in Django admin? -

I have two models, and they are related, but this relation has been implemented in business logic, and database barriers Along with, not as foreign key. The APAI Degezza administrator provides only one optimization in that respect - I am looking for a way to engage inline forms based on my own custom logic. Is it possible that Somneho? Maybe with some third-party applications, such as grappie?

web - Unrecognized escape sequence and Server Error in '/' Application in asp.net -

This is the error that I was trying to solve. Can anyone help? I just copied the thing written in quotes from the web.config file in asp.net but this error is not allowing for proper connection. Error in this part is \ myDatabase . I have tried to replace \ myDatabase with \\ myDatabase or / myDatabase or // my database . Nothing works but nothing does help. The Web.config file is: - & lt; Configuration & gt; & Lt; ConnectionStrings & gt; & Lt; Add name = "ConnectionString" connectionString = "Data Source = (LocalBible) \ v11.0; Attach debufffilename = | DataDirectory | \ myDatabase.mdf; Integrated Security = True" Provider Name = "System.Data. SQL Client" /> ; & Lt; / ConnectionStrings & gt; & Lt; System.web & gt; & Lt; Compilation debug = "true" targetFramework = "4.5.1" /> & Lt; HttpRuntime targetFramework = "4.5.1" /> & Lt; /system.web> & Lt; / ...

Read-only JSON object in node.js -

I need to give the result as a JSON object to the user and I cache the results. In some cases users change this result object and the revised version is constantly available to users. To avoid this, I am currently cloning the result, but it leads to a heavy overhead as a very heavy JSN object. So I just want to make JSON to give results and to avoid the clone process. How to make a JSON object non-editable? You can use Object.freeze () for it: Var obj = {a: 'a', b: 'b'}; Var freeze obz = object Freezes (OBJ); Freeze ozz A = 'C'; Console.log ("% j", Freeze Obze); // print {"a": "a", "b": "b"} console.log ("% j", obj); // print {"a": "a", "b": "b"} console.log (obj === freeze oblique); // Correctly prints

eclipse - Shortcut command/way to fix Java Sonar error -

According to standard coding practice, "left curling brasings should be located at the end of the lines of the code" For example, / * is not good coding practice / / and {} / * good coding practice * /} else {} Actually I ran sonar my java project Due to the above rule, I found more than 6000 errors. Is there a shortcut to eclipse or to some other way to fix these errors? Open Java files (where errors occurred) and "Ctrl + Shift + F" key for format Use the. Then the code will be formatted according to the "Formatter" settings

android - Change actionbar menu in fragment -

I want to load another menu XML while loading the piece. I am using this code in the main activity: @Orride Creative Options menu on the Public Boolean menu (menu menu) {getMenuInflater (). Flowers (menus menu, menus); Back true; } I am using this code in a piece: @Override Creates the public at zero (bundled saved instenstate) {super.onCreate ( SavedInstanceState); SetHasOptionsMenu (true); } Override public zero on @CreateOptionsMenu (menu menus, menu infletter info) {getActivity () GetMenuInflater () Flood (R. menu framemart menu, menu); Super.onCreateOptionsMenu (menu, inflater); } When the user loads the piece, then the activity menu should be removed, then the fragment menu should be loaded onto the action. And when the user clicks on the back button from the piece of the piece, then the pieces menu should be removed, the main activity menu should be loaded in the action bar. Now the code is not removing the old menu, it is adding new menus to the old menu. I ...

joomla2.5 - I get SQL syntax error -

I use Joomla 2.5.27 and Community Builder 2.0.2. I use the CB rank plugin for Community Builder I get the error There is an error in your SQL syntax; Check the manual related to your MySQL server version for the correct syntax to use on the nearest 'and confirmation = 1 and approved = 1' on line 1. SQL = SELECT R2yze_comprofiler WHERE cb_points and confirmation = 1 and approved = 1 from COUNT ( id ) / Blockquote> How to fix this error PHP code // Calculate the rank if ($ ordertype == "less") {$ _CB_database - & gt; SetQuery (select "#__comprofiler from COUNT (` id`) WHERE` $ field name` & lt; $ user field and 'confirmation' = 1 and 'accepted' = 1 ');} and {$ _CB_ database-> gt; "$ Field name" & gt; $ user field and 'confirmation' = 1 and 'accepted' = 1 ") from SELECT COUNT (` id`);} $ value = $ _CB_ database-> loadResult () + 1; Full PHP code gt; cbfold_rank ...

asp.net - Check box not called by jquery -

I have the following web pages that have a check box and text box ` & Lt; / TD & gt; & Lt; Td> & Lt; ASP: Text Box ID = "TSTEEM" system = "multiline" runat = "server" maxlend = "200" height = "70px" width = "201px" enabled = "wrong" & gt; & Lt; / ASP: text box & gt; & Lt; Asp: RegularExpressionValidator ID = "Regular Expression Vendor" runat = "server" controltovalend = "TSTEMmail" errormax = " Please enter a valid email." ValidationExpression = "\ w + ([-. +] \ W +) * @ \ w + ([-.] \ W +) * \ \ w + ([-.] \ W +) * (. [;] \ S * \ w + ([- +.] \ W +) * @ \ w + ([-.] \ W +) * \ \ w + ([-.] \ W +) *) * & gt; ; & Lt; / ASP:. RegularExpressionValidator & gt; & Lt; Br / & gt; & Lt; Br / & gt; & Lt; / Td> & Lt; / Tr & gt; ` Jquery Code: $ ('#ChkCcList'). Click (function () {if (! $ ...

Mysql sum on total in multiselect -

I want to total and pay off total_price_incl_tax. If I use the first query then I get rows from all the selected columns. It works fine but I only need yoga, so I changed the query. Select total_price_incl_tax, (SELECT SUM as the sum) from sale invoice as `invoice_payments` for total` invoice_ID` = s.id and invoice_type = 'sale'). It has been sd like ssad Administration_ID = 10605 and `` `` `` `` `` `` `` `` `` `` `and` `` `` `` `` `` `` `` In the form of 'sales' (`total_progress_in_c_taxa` & lt; & gt; (SELECT SUM (` amount`)) (select SUM (sum) `invoice_payment` WHERE` invoice_ID` = s.id and invoice_type =' sale ') The problem in the second link is that the sum of the subkey (payment) is not correct. It has the value of the last line and not the total. SELECT COUNT (*), in the form of the total amount (total_price_incl_tax), (the amount selected from `invoice_payments`` Invoice_id` = s.id and invoice_type = 'sales') As sales have been p...

vb.net - Driver, COMException errors -

I am using the following code to scan documents: slow Manager = New device manager at Deviceinfo = manager.DeviceInfos.Cast (DeviceInfo's) (). FirstOrDefault (function (D) di.Properties ("name"). Value = deviceName) If the device is not an interface then exit the apple dim device device = deviceinfo.Connect Dim dlg = new common dialog item item = .ite item (1) Properties ("bits per pixel") Value = 1 item Properties ("Horizontal Resolution") Value = 200 items. Properties ("Vertical Resolution") .Value = 200 Dim img ImageFile = dlg.ShowTransfer (item, FormatID.wiaFormatTIFF, False) In the last line, I get 2 different error codes I sometimes get me 0x8021000E , which, according to the page, means a WIA_ERROR_EXCEPTION_IN_DRIVER error. Sometimes I get COMException, according to Remote Procedure Call 0x800706 BE % windir% \ wiadebug.log by default But I did not find any log file there. I got a file at % windir% \ debug \ wiatrace....

plsql - count records from a table all the time whenever a select query is performed -

Whenever a specific query is made in the schema, then I should count all the records in a table. Every time I select (count) the selection count (*) I want a utility, process, funk etc. that count the records in the table Note: I use the SQL devloper tool . The query looks particularly odd, it can actually cripple your database (optimization mode and Depending on the level of access to the database, this would be "kill"). The only way I see is to use the right graded audit (DBMS_FGA). select_sql: = sys_context ('userenv', 'current_sql') should be easier than example to add something; Choose instr (select_sql, 'select / * counter * / count (*)') = 0 then nb_rows: = execute immediately ('select_sql ||') '/ select / * counter (*); end if; And store results in a dedicated table or send elsewhere. Of course you will generate a trigger per table.

python - pyspark: Save schemaRDD as json file -

I am looking for various other devices in JSON format to export data from Apache Spark. I think it should be a very easy way to do this. Example: I have the following JSON file 'jfile.json': {"key": value_a1, "Key2": value_b1}, {"key": Value_a2, "key2": value_b2}, {...} Where each line in the file is a JSON object These types of files can be easily read in Piespark, and then the jsonRDD line with jsonRDD = jsonfile ('jfile.json') (Key = value_a2, key2 = value_b2)] [line (value = value_a1, key2 = value_b1) Now I get these types of files pure JSON I want to save the goal. I found this entry in the Spark User List: After doing this, the text file appears line (key = value_a1, key2 = value_b1) line (key = Value_a2, key2 = value_b2) , i.e., JasonRDD is clearly written in the file. After reading the Spark User List entry, I was expecting an "Automagic" conversion back in the Jason forma...

recurring billing - PayPal CreateRecurringPaymentsProfile Invalid token -

I am trying to make recurring payments using the SOAP API, I have followed the steps outlined in the PayPal API manual : 1- Receive the call "Set Express Express Checkout" API 2 - Token and redirect the buyer to PayPal site. 3- After the user is finished it will be redirected to my feedback page. 4- Call "Express Express" API 5- Call "CreateRecurringPaymentsProfile" API. My call SOAP structure: & lt; Soapenv: envelope xmlns: soapenv = "http://schemas.xmlsoap.org/ soap / envelope /" xmln: kalash = "kalash: ebay: api: paypal api" xmlno arn 1 = "kalash: ebay: apis: ebillbage content "& Gt; & Lt; Soapenv: header & gt; & Lt; Uran: RequesterCredentials & gt; & Lt; Urn1: credentials & gt; & Lt; Urn1: Username & gt; '+ United + +' & lt; / Urn1: Username & gt; & Lt; Urn1: Password & gt; '+ PW +' & lt; / Urn1: Password & gt; & Lt; Urn1: sig...

jssor - How do I create external (or at least external to the slider) links on the thumbnail navigation? -

I have been working with JSSer slider for the past few days and it is considered very good, but when I became active Prefer to add additional links to thumbnails, which link directly to the page highlighting those sliders. Below you see that I have added a link to the thumbnail, which appears without any problems on a browser, but not click-enabled. I believe this is the division of "thumb" Because of being inside, when JSSor behaves as an object when clicked. & lt; Div & gt; & Lt; Img u = "image" src = "img / slide.jpg" /> & Lt; Div u = "thumbs" & gt; & Lt; Img class = "i" src = "img / thumbnail.jpg" /> & Lt; Div class = "t" & gt; Service title & lt; / Div & gt; & Lt; Div square = "c" & gt; & Lt; A href = "link_to_service_page.html" & gt; Learn more & lt; / A & gt; & Lt; / Div & gt; & Lt; / Div & gt; ...

jQuery issue with $(window).height() and .width() in IE8 -

I am developing some types of pages and I need to work the following code in IE8: JQuery: $ (function () {findHeight (); $ (window) .on ('resize', function) {findHyight ();}); Function findHeight () {var WindowH = $ (window) .height () - 20; Var window = w = $ (window) .width (); Var window W_minusMenu = $ (window) .width () - 290; $ ('Body-type') CSS ({'Width': windowW, 'max-height': windowH}); $ ('.cont- right'). CSS ({'width': windowW_minusMenu})}} }}; .body-type is just one of the main content, everything on the page raises up. Also .cont-right What is a content on the right, on the basis of which I want a certain width of the window On size . Menu-left Float left menu is set on the page. The problem is that it does not work in IE8 and I do not know why please help me with that! Thanks!

javascript - Using protractor to test infinite scrolling -

I do not think it's infinite scrolling strictly, but it was the best I could think of what I'm seeing Makes comparisons. . However, we are using ng-grid to show data in the table. We have about 170 items (rows) to display when we use the NG-Grid, it creates a criminal when I observe this repeater from the browser, it is limited to 35 items and, as you Scroll down the list, you start losing the top row from the dom and the new rows are added to the bottom etc. (That's why I do not think so strictly infinite scraps In the form of scrolling, usually only adds more rows) That's all I am clear that always 35 'ng-repeat = lines in lines provided' Far away you have to scroll down This test is great until it comes up. I need to get the text for each item in the list, but element.all (by.bending ('item.name')) by using or by.repeater or by.css Now there are only 35 items present on the page. Now for my question, how can I make it so that I can hol...

c# - Creating an int inside an if/else and using it later -

I am playing with the stuff here and I am having trouble with anything. I have an input; It can be either a number or a letter I have to check whether it is a number or a letter. So I used a if for it, if input is a number, then my code should be an int. If this is a letter, then it should be made of a different int but I can not use the integer later for some reasons. Any way to solve this? console.light line ("length (ms)"); String I = console Readline (); Int I2 = Int32.Parse (I); Console.light line ("height: r for random"); String L = console Readline (); // so it asks for an input, for which I want to check here what it is (L! = "R") {int he = int32.Parse (L); } Else {Random Hi = New Random (); Int he = hi Next (1, 50); } // ---------------------- I want to use ints here while (true) {random R = new random (); Random R2 = New Random (); Int H = R2 Next (1, he); Int RH = H * 100; Console; light line ("height {0}", h); Console.Beep ...

java - How to manipulate variables in deep class -

I just started learning Java and I think this is a very basic question but I do not have the right answer yet. Found, so I try here. I want to show the names and details of some animals in my console, but I do not know how to manipulate the variables from any class of the class. I think that I have to use parameters but I do not know how to use them in class ... My "Animals." public class animal {private string name; Public stable string description; Public string toasting () {return "jay needle" + this.nom; } Public Zero Diary () {System.out.println (toString ()); } Public Zero direDESCRIPTION () {System.out.println ("Description:" + this.DESCRIPTION); } Public string getNom () {return name; } Public Zero SatName (string name) {this.nom = nom; } Class vertebra {int nbr vertébre Class Memfefer {Class Our (string name = "Pomba" String description = "Description" Poumba ";} class Cimpanj {string name =" Chita "...

Ruby Ohm: do not raise unique index violation, just return false -

When I try to save a unique feature, it generates an error if the feature is not unique Is there any way that instead of raising the error, just false change can be returned? This is the type of code I want, but if a domain is not unique, then it raises an error, so it's never other section: domain = domain.new (: domain = & gt; root_domain) if domain ) Finally use the Ruby Rescue: Domain.save Domain Rescue Om: UIINDEXExIllation Returns False and

linux - check if the input is a vowel -

I am beginning with Bash scripting and which I have studied in other programming languages, most of them apply For bash I have to check whether the user has entered a vowel or not. I came up with this: #! / Bin / bash read -p "Enter something:" char if [[$ char -eq [AEIOUEiou] *]]; Then the "vowels" resonate the other "consonant" fix but when I run it on IdeOne, I get an error: Prog.sh: line 3: [[: [AiUUEUU] *: Syntax error: Operand expected (error token is "[AEUUEUU] *") Can anyone tell me that What is wrong here and how to improve it? I know that many other conditions should not be cleaned together in a clean way. I am trying to avoid it. you == operator to match this globe: #! / Bin / bash read -p "Enter something:" char if [["$ char" == * [AYUU]]] ;; Then the "vowel" is used to match the second "Exonontant" fix -a - Test according to man : INTEGER1 -Ec INTEGER2 is ...

Hazelcast Near-Cache not working -

I am currently working on integrating hezelcast in our system and trying out caching, but I can go to this issue. I'm configuring hezelcast via spring with my configuration: & lt; Hz: hazelcast id = "instance" & gt; & Lt; Hertz: config & gt; & Lt; Hertz: Management-enabled center = "true" url = "sanitized" update-interval = "5" /> & Lt; Hz: network port = "5701" & gt; & Lt; Hertz: Joining & gt; & Lt; Hz: multicast enabled = "wrong" /> & Lt; Hz: tcp-ip enabled = "true" & gt; & Lt; Hz: Members & gt; # {SystemProperties ['hazelcast.members']} & lt; / Hz: Members & gt; & Lt; / Hertz: TCP-IP & gt; & Lt; / Hertz: Joining & gt; & Lt; Hertz: Interface & gt; & Lt; Hertz: Interface & gt; 192.168.24 * & lt; / Hz:. Interface & gt; & Lt; / Hertz: Interface & gt; & Lt; / Hertz: Networks ...

bash. execute one script from another and exit -

Can you please help me with the following: I try to execute a script I am doing - test2 - using other script test1: bash -c "/ test2 -f $ (printf" /etc/test2.conf "" $ @ ")" Everything is fine The problem is that test2 script runs continuously and can not be interrupted and test1 script accordingly is also going on. It is unnecessary, test1 should be stopped. I need all from test1 script to execute the test2 script and to exit, I only want to work without cron or any similar utilities. Thank you. test1 is already a bass script, so it is not necessary to call bash. If test2 is executable (+ x is set) then it is a command and it can be used directly. / path / to / test2 -f $ (printf "/etc/test2.conf" "$ @") & Amp; Runs an ampersand command and it's running. Test1 is able to exit from then. When you close the console, logout, and nohup fixes, a hangup will be terminated by the signal. Nohow / path / ...

javascript - How to get base64 from input file in IE without using FileReader or HTML5 -

I hope I can help you with a file from an HTML input file element Need to get. This is HTML: & lt; Input type = "file" name = "allegatoImg" id = "allegatoImg" onchange = "javascript: readURL (this)" /> And this is Javascript: function readURL (input) {var mimeType; If (window.FileReader) {if (input.files and input.files [0]) {var reader = new FileReader (); Reader.loads = function (e) {var dataURL = e.target.result; MimeType = DataURL.split (",") [0] .split (":") [1] .split (";") [0]; If (mime type == 'image / jpeg') {jQuery ('# iggleGlato'). Et ('src', e.target.result); // jQuery ('#fotoTemp'). Attr ('src', e.target.result); ProvaInvioImgSrcToServer (); } And {warnings ('error neela let file. Controller's Sia Stato Carriata un File Constance JPG.'); Return; }}; Reader.readAsDataURL (input.files [0]); }} And {f = document.dettRichAbbForm; Doc...

android - Download a JSON string from a website with AsyncTask -

I have an Android application and I want to download a JSON file from a website using AsyncTask. So far I have Public category downloader task asink & lt; String, zero, string [] & gt; {Private MyActivity myactivity; Personal reference references; Private string rawfid [] = new string [3]; Downloader Task (Myactivity Maternity) {myactivity = parent; Context = parent.getApplicationContext (); } @ Override protected string [] doInBackground (string ... parameter) {boolean full = false; InputStream input = null; OutputStream Output = Null; HttpURL Connection Connection = Faucet; For (int i = 0; i & lt; params.lamp; i ++) {try {url = url} new URL (perm [i]); Connection = (HttpURL connection) url.openConnection (); Connection.connect (); Input = connection.getInputStream (); } Hold (exception e) {}} return raw; } @ Override Protected Zero at PreExecute () {super.onPreExecute (); } @ Override Protected Zero at PostXextrack (string [] strings) {if (maturity! = Empty) {myact...

jquery - Create multiple hyperlinks in single cell of JQGrid -

Image
I am developing an MVC4 application, which has good customer side interaction but today, I have got a specific requirement that JqGrid's cells can have dynamic numbers The approach I am using is: To form an array of items in the controller, be formatted as hyperlinks in the Jackgreat This array is called JQGrid cell Receive as the value and array array for formatting each R = hyperlink Call controller method for each hyperlink The controller slice for jqGrid : var jsonData = new {rows = (list Select new {id} line from person.Contact order no, cell = new string [] {convert.Tostring (row contact order noon), convert.Tostring (row contact not opporter), convert.tostring (line serial number) Convert.ToString (row.ModelNo), Convert.tostring (Row.Capacity), Convert.tostring (new obz [] {new {linktext = "22 PDF", link SRC = "MyDrive \\ 22.pdf"}, New {LinkText = "33.pdf", LinkSRC = "Ma Driv \\ 33.pdf "})}}). ToArray ()}; Jason return...

ServiceStack might create several sessions instead of one on concurrent requests from one browser -

Supports service stack sessions. Does the servicestack use some other mechanism, except cookies, to reliably identify the browser? We believe this scenario: I open a browser with multiple tabs (previously saved) and the browser does not have any session related cookies (SS-PD etc.). All tabs go to simultaneously servers and server (service stack) can create multiple sessions instead of one. The scenario may look artificial, but I'm surprised that the service stacks "fix" No, scenario with concurrent requests from non-identifying browsers There are ss-id and ss-pid cookies to identify user sessions in which session identifiers , which essentially only continue An example of how to match or request anonymous requests for the same user session for ServiceStack, without the session ID (contained in cookies) in the registered code at the place entered in the session in the ID in the ICacheClient there's no way. But cookies are sticky to nature, t...

Using UI, how to see if directory is a git submodule -

I am new to GIT ... Using any UI, like Turtle GIT or Sourty, see it quickly Is there a way in which a directory is part of a GIT subdue or local repo? I especially do not want to use any command line command to detect it. Thanks Ah, just saw it: Turtle menu for a submodule " Git Commit Submodule "will show that it will be just" Git Commit "for a regular portion of the tree.

php - Permanent redirect to subfolder with .htaccess -

I am setting up Symfony2 project on a shared host and I'm getting some things I Symfony2 by default sending them Controller or main files (which is in many systems, inside the file index.php ) is the directory of the / web so that I can see all the project on shared hosting Public_ html will not work until I add the / web at the end to the URL. It is poor and noisy for users because they know the page for the domain. I follow the .htaccess : // 301 redirect complete directory redirect match 301 /(.*) / using the web / $ 1 // redirect I am trying to Prevent directory listing all-indexing Since hosting this is not working, this line is bad in the .htaccess file, so how can I ride this problem? In root .htaccess you can use this mod_rewrite rule: // Prevent Directory Listing Options All-Indices Revive On RewriteExell ^ ((!! Web! ).*) $ / Web / $ 1 [L, NC, R = 301, NE ]

jackson - How to use Couchbase Java Client in a Dropwizard Project? -

I am looking at this project and wondering if it is possible to use it within a project. It seems that this will be a natural fit, because Couchbase is basically a JSON database, but the Java client does not seem compatible with Jackson. As far as I can tell, the Couchbase Client Library also includes incompatible with all other Javasen Lib Libs, which is really weird. I found a class that first looked promising but on closer inspection, the library is using a shaded version of Jackson ( com.couchbase.client.deps.com.fasterxml.jackson. Core with a re-written package). Either way, because the drawer wizard uses MSN documents to jason and jersey through the REST API, what is the least friction method to use the watchbase-java-client libraries is? Is this possible even in this case? Using couchbase with the drawer is definitely possible JSON manipulation for the convenience of client SDK developers. RawJsonDocument category. In fact, you can use stringed JSON (exit any fr...

xampp 1.8.3 with PHP 5.5.15 - SID variable is undefined -

Good day every, I'm running XAMPP 1.8.3 with PHP 5.5.15, And when I point out my browser (the latest version of Chrome or Firefox), the following error: Notice: Undefined variable: in SID ... \ index.php on line 1 The first line of the index looks like the following: & lt ;? Php if (! ($ SID)) {session_start (); }? & Gt; This code is used to work in previous versions of PHP (4.xx). After some online search, I found out that I need to set session.use_trans_sid instead of 0 (default) I did this, but the problem still persists Does anyone know why this is happening? Thanks in advance,

python - What is the difference between 3/2 and -3/2? -

I am beginning with programming and Python. I am conducting some simple mathematics so 3/2 gives 1 in Python interpreter as we know but -3 / 2 Gives -2 . Can you point out the difference here? In Python 2, / does it mean integer division That result, if this is not an integer, then the next integer value is rounded when the value is negative, it naturally rounds to the maximum number of negative numbers. Intensely, the result of the integer division is the result of the float division. For this reason, the integer division is also commonly known as. floor (1.5) # returns 1.0 floor (-1.5) # returns -2.0 __future__ import at the top of your module By entering from partition, it is possible to turn this behavior into Python 2. This will point to the import / operator only to the correct partition (float division) and enable the clear floor division (integer partitions) with the // operator. These relations are standard in Python 3. __future__ import div...

symfony - i18n Form translations with knp Doctrine extension -

I'm using "" to translate the institutions so far I'm working great now I I have come to be a common solution, which works for any kind of languages, so I would like to use an embedded form (collection) though managed for a single unit. Now apart from adding all the new translations, it is working also that translatable_id not being set up. Has anybody tried to achieve this? I was just thinking that there is an easy way to do this, to avoid things from the confusion. So far, very good, here are my types so that you can understand architecture better. type type = Add ('name', 'text', array ('label' = & gt; 'name')) - & gt; Added 'allow_delete' = & gt; false, 'Allow_add' = & gt; wrong, 'label' = & gt; false, 'allow_add' = & gt; 'translation', 'collection', array ('type' = & gt; new link translation location () Gt; true)); } Public Function Se...

python - Pandas dataframe - running sum within cluster -

मेरे पास x cluster_id 0 1 1 1 3 1 2 2 2 3 5 2 4 4 3 मैं उत्पन्न करना चाहता हूं x cluster_id s 0 1 1 1 1 3 1 4 2 2 2 3 3 5 2 7 4 4 3 4 अर्थात् s चल रहा है x , लेकिन क्लस्टर आईडी में परिवर्तन होने पर इसे रीसेट हो जाता है। यह कैसे हासिल किया जाता है? वैकल्पिक रूप से, यदि यह आसान है, तो यह ठीक हो सकता है x cluster_id 0 1 1 4 1 3 1 4 2 2 2 7 3 5 2 7 4 4 3 4 अर्थात् s के लिए समान क्लस्टर के सभी मान एक जैसे होते हैं, और क्लस्टर में कुल राशि के अनुरूप होते हैं। इसके अतिरिक्त, मैं इसे नमस्कार करना चाहता हूं ताकि मैं अंतिम पंक्ति प्रत्येक क्लस्टर का: x cluster_id s 1 3 1 4 3 5 2 7 4 4 3 4 (ध्यान दें कि सभी क्लस्टर आईडी अलग हैं) । आप यह कैसे कर सकते हैं? आप .cumsum () का उपयोग कर चलने वाली योग प्राप्त कर सकते हैं के साथ .groupby () & gt; & gt; & gt; Df x क्लस्टर_आईडी 0 1 1 1 3 1 2 2 2 3 5 2 4 4 3 & gt; & gt; & gt; Df ['s'] = df.groupby ('cluster_id')। Cumsum () & gt; & gt; & gt; Df x cluster_id 0 ...

JSON value parse with Python -

I have such type of JSON bits and I need to use only datetime fields instead of the first integer entry But I am not getting any way to do this which is using Python. Any ideas? "," "Number": 123, "values": [["95", "2011-12 - 4"], [" 90 "," 2011-10-03 "]] You assume in a loop Can open: Import json data = json.loads _ (_ _ _ _ _ _ _ =), date in data ['value']: # 'date' Do something with> I have assigned the first value to code in each nested list, which traditionally tells the code reader that you are ignoring that value. If you want to do something useful with the date, you may want to parse it: import json import datetime data = json.loads (your_json_value) _ For data, date in ['value']: date =) datetime.datetime.strptime (date, '% Y-% m-% d'). Date () Demo: & gt; & Gt; & Gt; Import json & gt; & Gt; & Gt; Import Date Time & g...

Getting fatal error on push and clone the git -

I was able to push and pull git remote till yesterday. I do not know (or remember) what I have done today, suddenly I can not go to remote grip repo. I'm getting the following error $ git push count objects: 83, done. Using Delta Compression up to 8 threads. Compressing objects: 100% (16/16), done. Writing commodities: 100% (17/17), 1.32 kb. 0 bytes / s, total 17 (delta 12), re-0 (delta 0) remote used: Fatal: Unsolved Delta dropped after error: Unpack unsuccessful: Unpack-object for unusual exit / / Meswar / jit / aps / imap [Remote Dismiss] Master - & gt; Master (modifier error) Error: Some refixes have failed to push '//myserver/git/apps/myApp.git' and when I try to clone again I'm getting the error. $ cluster cluster / messenger / jitam / app / IEPIgit / clone in 'My app' ... Fatal: Unable to read the tree 18295307f1270da3c09e3de91890652af4ff7ca8 Warning: The clone is successful Happened, but checkout failed. You can check with the 'GIT s...

javascript - Meteor Iron Router How to get POST data -

I am trying to pass post data to an iron router root from meteorite meteorites but it does not work. The request body is empty. I have tried to output the request body to check whether the data was present or not, but it is only empty. router.out ('/ api / gateways', function () {body = this.request.body; console.log (this.request) // this.response.write (body ); This.response.end ("called");}, {where: 'server'}) Any ideas? Thank you. request.body is empty because iron URL-encoded data There is a lack of middle-class responsible for the removal. This is a Bug , which will be resolved hopely in later versions. For now, you can just add: router.com first action (iron router.business.nerncode ({extended: false)); Somewhere else on your server and it should work fine. See more details.

opengl - GLSL Shader Compiles On An Older Computer But Not Another -

The 'texture' function returns an error while compiling this shader on one computer, but not on any other. The OpenLL version on which Shader's compilation is 3.1. Another computer running OpenGL 4.1, however, will not compile with these errors. Error: C1105: Can not call a non-function 0 (58): Error C1105: can not make a non-function - We looked online, but could not find the answer. The documentation says that 'texture2D' and 'shadow2D' will work as a replacement, but 'Shadow2D' indicates an error that it was removed after GLSL version 140, even though the OpenGL reference in the compiling program is 3.1. My understanding was that the graphics cards were backwards compatible for the previous GSL versions. Here is the problem shader: # version 140 in vec3 state; Vec2 in texCoord; Vec3 in general; VC3 General View_vs; Out vec3 normal Shadow_vs; Out vec3 eyeView_vs; Vec3 lightDirView_vs out; Vec2 texCoord_vs out; Out vec4 shadowCoord_vs;...

c++ - Overlaping rectangels and clipping at the bottom in opengl -

I have to make some 3D figures using OpenGL (Older Versions). I have 3 GL_POLYGON rectangles that are connected to each other and which are different colors. My problem is that when the final color is added (the last added rectangle) is always on top of other people, for example Cyan is above a pink and yellow, and pink is a yellow color I have also seen that some clippings below the data, which I think is due to gluPerspective () what I am trying to achieve, from Z ++ to the center and Walking through the eyes y + axis (which I think is I I am walking around with Mayab am) and give overlapping and also remove Cliping. Any idea why this happens and how it is decided? The code is gone: #include & lt; GL / glfw.h & gt; Int main () {int width, height; Int frame = 0; Boil Run = true; GlfwInit (); If (! Glyph OpenVindo (700, 800, 0, 0, 0, 0, GLFW_windows)) {glfwTerminate (); Return 0; } GlfwSetWindowTitle ("GLFW Application"); While (running) {frame ++; Gl...

linux - Reading userspace memory from kernel module -

In a kernel module, I restart through all the processes and vm_start and Vm_end address The problem is that these addresses are in Userspace and from the kernel module, I will need to map them through kmap the issue which I Playing is that when users are using follow_page to get access to the page, half of them If this taps, possibly because there is a better way to read UserSpace memory or is there a way to solve the mistake and try to read it again? If there is a better way to present, please mention it.

android-studio project git private folder -

I have an Android project, I'm working on using the Android Studio and GIT repository. I want to start working on different files (graphic files) which will not be part of the app by default. Afterwards I will edit them and add them to the app (things like icons and background images). I want to include them anywhere in the git repository What is the best place I was thinking about putting them in a folder that is the root of the GIT repository and it has been given a descriptive name. Is there a common way of doing this? git / personal / app / build / gen / gradle / other-files What is 'private' what I want? Maybe I want 'property' or 'personal property' What do people usually do? I will nest them in assets under any other folder. I do not know which domain you are working on, but I think it would be best as descriptively as possible. I can only make sure that you can ignore that directory in GIT if you do not want to push those files in your...

shark sql - Does Spark support insert overwrite static partitions? -

I have seen in the current Spark Sql manual that putting in a dynamic partition is not supported: Major Hive FEATURES Spark SQL does not currently support putting in tables using dynamic partitions. However, what is insert / overwriting in static sections? "post-text" itemprop = "text"> Spark SQL currently does not support versioning as SPARC 1.1 to insert in the table using dynamic partitions. Static is supported, you must write data in the hive table location.

How to consume a HTTP response page (with XML as response) periodically in Android? -

I have a simple page that updates itself and generates a response in XML I am surprised how these changes in Android are shown every 1 minute by the user, I need GCM or any other tool for this to push it or it is not necessary. matter? I have read everything about GCM and as I already have a webserver HTTP I will not need to configure another server. I appreciate the help, thanks.

java - Logarithm for BigInteger -

मेरे पास BigInteger नंबर है, उदाहरण के लिए 2 64 से परे अब मैं उस BigInteger संख्या के लॉगरिथम की गणना करना चाहता हूं, लेकिन विधि BigInteger.log () मौजूद नहीं है मैं अपने बड़े BigInteger मान के (प्राकृतिक) लघुगणक की गणना कैसे करूं? यदि आप मनमाने ढंग से बड़े पूर्णांकों का समर्थन करना चाहते हैं, तो बस इसे करना सुरक्षित नहीं है Math.log (bigInteger.doubleValue ()); क्योंकि यह तर्क यदि डबल सीमा (लगभग 2 ^ 1024 या 10 ^ 308, अर्थात 300 से अधिक दशमलव अंक) से अधिक है, तो विफल हो जाएगा। यह मेरा नुस्खा है: निजी स्थिर अंतिम डबल LOG2 = Math.log (2.0); / ** * बिगइंटेगर के प्राकृतिक लॉगरिदम का मूल्यांकन करता है वास्तव में बड़े * पूर्णांक (व्यावहारिक रूप से असीमित) के लिए काम करता है * * @ परम वैल तर्क, सकारात्मक पूर्णांक * @ परत से प्राकृतिक लघुगणक, जैसे & gt; Math.log () & lt; / tt & gt; * / सार्वजनिक स्थिर डबल लॉगबिगइन्टेगर (बिगइटेगर वैल) {इंट बॉक्ले = वैलबाइट लैंग () - 1022; // 60..1023 में कोई भी मान ठीक है अगर (ब्लेक्स & gt; 0) val = val.shiftRight ...

c++ - Modify class variable via pointer to reference -

मेरे पास यह क्लास घोषणापत्र है जो hour , minute और सेट करना चाहिए सेकंड मेरे समय वर्ग के भीतर चर: वर्ग समय {सार्वजनिक: int hour; // 0-23 इंट मिनट; // 0-59 इंट सेकेंड; // 0-59}; अब, यह अगले कोड उस वर्ग की परिभाषा के लिए काम करना चाहिए: समय घड़ी; समय * घड़ीपीटी = & amp; घड़ी; clock.hour = 8; clock.minute = 12; * ClockPtr.second = 0; क्या यह काम करेगा? मुझे लगता है कि संकेतक पता और घड़ी के मूल्य की तरफ इशारा कर रहा है, यह काम करना चाहिए मुझे सही करें अगर मैं गलत हूँ तो कृपया। जैसा कि टिप्पणियों में बताया गया है, आपको * और । ऑपरेटरों को dereferencing। बस उस रेखा को बदलें * clockPtr.second = 0; से (* clockPtr) .second = 0; या जैसा इंगित किया गया है clockPtr-> second = 0;

git - .gitignore **/* but not <something>/* -

I have .gitignore (especially a partially designed spring application's webpage folder In) include: ** / *! .gitignore! Meta-INF / *! WEB-INF / *! Index.jsp I want to be created except by ignoring all those files except those which are with the lines of negation, but ! lines do not work and all files in those folders are ignored. I tried ** / * with entry: * , / * , / ** Instead of / * , none of those who are going to solve this issue. I do not like to explicitly list which to not listen and to explicitly add items, although I am currently doing this. Any thoughts? found solution: specifically ignore files in the current directory, and do not ignore folders whose Track all, instead of ignoring the content of those folders I want to content. The resulting .gitignore file is: / *! .gitignore! Meta-INF! WEB-INF

java - Best approach to display multiple images in JSP -

I have a JSP where I want to display the images of the vehicles from the database. My unit class looks like this: Public category vehicle equipment serializable {Private stationary last long serialvarsian UID = 1L; @ID @ Generated Values ​​(strategy = generation type AOTO) @column (name = "id_vehicle") private id idahl; Private string model; Private string maker; Private byte [] image; @ Transgen Private String Encoded Image; // Getters and setters} One way to display all the images in JSP looks like this: & lt; C: forEach item = "$ {vehicle}" var = "v" & gt; & Lt; Img src = "data: image / jpg; base64, & lt; c: out value = '$ {v.encodedImage}' / / width =" 214 "height =" 138 "/> means the byte array is encoded for the string and everything is new list : Import java.util.ArrayList; Import java.util.List; Import org.apache.commons.codec.binary.Base64; Import Organization. Source: Imp...

awk: print everything but not the last nth columns -

मेरे पास इस रूप में एक इनपुट फाइल है: foo बार 08 320984 2384 bla foo बज़ 23 32425 32532 [...] अंत में हमेशा तीन टोकन होते हैं, लेकिन सामने में एक अज्ञात संख्या में टोकन होते हैं। मैं फ़ाइल को सीएसवी के रूप में फिर से लिखना चाहता हूं ताकि इसे अन्य अनुप्रयोगों द्वारा स्वचालित रूप से पार्स किया जा सके। मेरी वर्तमान awk कमांड है: awk '{print $ (NF-2) ";" $ (NF-1) ";" $ NF}' आउटपुट होना चाहिए foo बार; 08; 320984; 2384 ब्ला फू बाज़; 23; 32425; 32532 [...] अगर मैं आपको और फीडोरक्वाइ को समझता हूं: awk '{for (i = 1; i & lt ; एनएफ; आई ++) प्रिंटफ़ "% s% s", $ i, (i + 4 & gt; एनएफ? ";": एफएस); प्रिंट $ एनएफ} 'फ़ाइल फू बार; 08; 320984; 2384 ब्ला फू बाज़; 23; 32425; 32532 यह पिछले तीन क्षेत्रों के सामने ; जोड़ देगा। ऐसा करने का बेहतर तरीका हो सकता है।

sql - using a searched case in where condition -

I have recently got this stored procedure where it is using a markmark code called variable called In my selected statement, I would like to receive every market except Southern if the application passes futile. and marketcode =! 'South' If someone passes an unnecessary value, then I will use one instead. and marketCode = 'North' How can I join one in both of these? AND marketCode = (case @marketcode when zero & lt; .. not equal to 'south' .. .. & gt; Other & lt; .. equal to 'south' (End.) You can call it a or The condition should be able to be accompanied by: ... AND ((@marketcode is tap & marketcode & lt; & gt; 'south') or (@markcod not faucet and marketcode = @marketcode))

Python lxml - creating different forks of tree -

I edit to open an xml file using lxml, XML and then trying to save out different versions I am not, but I can not do it before removing the section to save, but to save the other, leave them in, to save 1 in the right way, to remove the section Is there, but there are still 2 deficiencies in which Area to leave. What am i doing wrong Here is a code example: lxml import etree parser = etree.XMLParser (remove_blank_text = true) tree = etree.parse (pathToXmlFile, parser) root = tree.getroot () etree1 = etree Tree1 from = tree Etreelkstrip_elements (Treel, 'product') tree1.write (pathToXmlFileOut1, pretty_print = true, Xml_declaration = true, encoding = 'UTF-8') etree2 = etree tree2 = tree tree2.write (pathToXmlFileOut2, pretty_print = true , xml_declaration = true, encoding = 'UTF-8') the problem is that Is tree 1 and tree2 are the same object (pointing to the same object in memory) While) you can not modify a variable without having to modify the ...

MathNet Matrix MapIndexInplace confusion about arguments -

MapIndexInplace is documented to take a funk (int, int, float, float). I do not know what the second float value is. Can anyone explain? funk & lt; Int, int, float, float & gt; Representative represents a function in which two floats and a float in the form of logic and return value in the form of a float. So the second float indicates the return value of the function. Map IndekInstes will provide this type of sign (or optionally each non-zero) matrix element with three arguments for each (index, index j, current value V) and replace the matrix element value with the value returned by the function.

Returning Array from Object using Accessor in C++ -

I'm new to C ++ and trying to know myself C ++ I write the code for my project , But I have to face difficulties in returning an array from class accessor. I have a class called loaddown that accepts array_a [] Load data class constructor copies memory block of array_a to an array, an accelerator, GetArray () attempting to return a pointer in the arrayA In the main (), I create an array of objects, objVec [obj_i], which collect data and collections in the class. When I try to return an array from LoadData and print the content, I get only the first element of the right element and return the rest of the memory address. I believe that the problem I am doing is either the way I am returning an array in the accelerator or the way I am calling getArray () I use the pointers There is a lot of trouble. I am struggling about this for about a week so that any suggestions and input will be appreciated! Thank you very much in advance. class load data {private: float * array; ...

odbc - Asterisk Realtime pattern matching -

I am using realtime db lookup utility to generate my extensions.conf It works fine, I specify a full number in the exten field, however if I try and use a pattern _0. For example, this does not work (gives an error that the extension is not found) If I use that pattern directly in the extension .conf, though it works fine. Thanks You probably need to read it You should also consider it ; While most dynamic realtime engines are used automatically; This file, 'Extension', is not specific, to activate dynamic real-time; Expansion, you have to turn them within each relevant reference; Extensions.conf syntax with a switch statement is:; Switch => Realtime / [[db_context @] tablename] /; The only option available currently is 'P' option, which rejects; Extension Pattern queries for the database If you do not have any patterns defined; In a particular context, this will save enough CPU time. However,; Note that is no longer recommended by using the dy...

git - Upstream merge commits in pull request -

While making any open-source development, it is normal to track against the upstream for a time when making any changes to a topic branch. What I have seen while bringing me back is that a merge commit has been created. If I prepare a pull request then this merge ends in the form of a lower PR. My question is, is there any harm in it? I have read that some people think that they are useless, but I feel like the fact that when I synchronized with the previous river, they act as a timestamp. Whether there is an acceptable practice to monitor upstream and commit merge. upstream git rebase master (Rebase) git push -f (Push your branch into your GitHub thorn: according to the current PR Will be updated) This works well if: Your PR is done in your branch Anyone Your branch is not actively using