Posts

Showing posts from March, 2012

python - Where to store web authentication session in PySide? -

I am creating a small application in Python; I use PySide for GUI and Django to read data from my web application. Everything works well, but I have login access, like dropbox applications. I want to store this information on the existing machine (like session, I do not want to login every time I open the application). Now my question is, what is the safest way to do this? Environment Variables? Normally when you have an API that you are displaying your app in the outside world ( Even your own desktop / mobile app), as part of the architecture, this API will be designed to be stateless. That's why your app should always include an HTTP header or any other way to keep authentication tokens that will identify the user to your API. You only log in once, and when the log-in process is successful, you should get an authentication token from your API, and then you will keep this token somewhere safe. You can also apply for authentication.

c# - Authentication failed because the remote party has closed the transport stream -

Image
यह sslStream.AuthenticateAsServer (serverCertificate, true, SslProtocols.Default, true) पर होता है; कॉल करें। मैं क्लाइंट प्रमाणीकरण करने का प्रयास कर रहा हूं मैं क्लाइंट और सर्वर दोनों को नियंत्रित करता हूं, दोनों सीएसएलस्ट्रीम के माध्यम से सी हैं I जब मैं एक नोडजे सर्वर का उपयोग करता हूं, तो यह पूरी तरह से कार्य करता है। लेकिन मैं सिर्फ किसी कारण के लिए सी # में मज़बूती से काम करने के लिए सर्वर को प्राप्त नहीं कर सकता स्पष्ट रूप से एसएसएल प्रमाणीकरण क्लाइंट के क्लाइंट प्रमाण पत्र का चयन करने के लिए प्रतीक्षा करने की आवश्यकता है, लेकिन जाहिरा तौर पर यह सी # एसएसएलस्ट्रीम वर्ग के लिए एक सुविधा में निर्मित नहीं है? मैंने पहले ही कॉल करने से पहले ऐसा करने की कोशिश की, लेकिन यह अभी भी तुरंत कॉल पर त्रुटियां आती है: मैं IE में सुरक्षा प्रश्न को न मानें कोई बात नहीं। मैं इस तथ्य के बारे में चिंतित हूं कि इस तरह के एक बुनियादी szenario के साथ sslstream बिल्कुल काम नहीं करता है। WCF ट्रेस से त्रुटि: System.Net त्रुटि: 0 : [7928] अपवाद # 13869071 में अपवाद: अप्रतिबंधित अपवा...

unityscript - How to make .net regex start searching from the end of the last match? -

I am new to reggax. Currently, I am trying to get all the results of the symbols without spaces without string and when they are finished, they start coming out. Regex = new Regex ("[^] +"); Var s: string; For (var i: int = 0; i This is the only 'speed' found. I have received the G-Command which looks fine after the last match, that is, I can not leave the spacebar. Besides, I am unable to understand it, because my pattern is var Pattern: Reggae = New Regex ("\ g \ [^] +"); Only throws errors about "unexpected characters". The reason for this is because \ is a survival in both unity character and regex Is eligible. To fix this, first add another \ before one (second must be redundant): var Pattern: Regex = new Regex ("\\" G [^] + ");

Java swing, adding array list to a component -

I want to do something like ArrayList & lt; String & gt; Users; Zeppel panel; Panel.add (user); But this is not legal because the zenith can not take the extras or strings, but rather a component should be taken. So I tried to figure out if there is a component that would take a string or better, an array list, is it possible, or is there a better way to do this?

xml - Get parent node using child node lxml python -

इस के लिए xml , xmldata = "" " & Lt; स्थानों & gt; & lt; महाद्वीप क्षेत्र = "अफ्रीका" & gt; देश आईडी = "84" देशनाम = "अल्जीरिया" & gt; & lt; / देश & gt; & lt; / महाद्वीप & gt; & lt; महाद्वीप क्षेत्र = "एशिया" & gt; & lt देश आईडी = "84" देश नाम = "भारत" & gt; & lt; / देश & gt; & lt; / महाद्वीप & gt; & lt; महाद्वीप क्षेत्र = "अमेरिका" & gt; & lt; देश आईडी = "84" देशनाम = "मेक्सिको" & gt; & lt देश नाम भारत मैं देश के नाम का उपयोग करके क्षेत्र का नाम प्राप्त करने की कोशिश कर रहा / रही हूं / देश & gt; & lt; / > फिर कोड को एशिया वापस कर देना चाहिए। मैंने जो कोशिश की है, आयात करें lxml.etree एट रूट = एट। फ्रॉमस्ट्रार्ड (xmldata) झंडा = झूठी महाद्वीप = "" देश = "" रूट.इटर ('महाद्वीप') में पड़ोसी के लिए: मैं पड़ोसी। ("देश") में: यदि i.a...

java - inserting element in 2D Array List -

I am trying to insert an element in an ArrayList. Elements are not being added and why I am not able to. What do I have here: t [0] [0] => account t [0] [1] => balance Class Banking 4 {Int i = 0; Array List [] [] T = New Array List [2] [10]; Scanner sc = new scanner (System.in); Zero addAccount () {for (int i = 0; i & lt; t.length; i ++) {if (t [i] [0] == faucet) {System.out.println ("Enter the account number : "); Int a = sc.nextInt (); T [0] [0] = new arrelist (); T [0] [0] .add (a); T [0] [1] = new Arrivits (); T [0] [1] .add (0); System.out.println ("The account number is:" + a + "Current balance:" + t [0] [1]); break; }}}}} ArrayList is not an array type to treat it in a way Instead you need to make nested arrives. // Create ArrayList & lt; ArrayList & lt; FooBar & gt; & Gt; List = New Arrestist & lt; ArrayList & lt; FooBar & gt; & Gt; (); // Add to the first layer list. Set (index, new a...

Mysql Distinct is not working with django ( am using windows 8) -

role_type = ClientUserRole.objects.values_list ('role_attribute', flat = true)। दिस्टिंक () इसके डुप्लिकेट देने के लिए मैं कैसे विशिष्ट भूमिका_अट्रिब्यूट मान प्राप्त कर सकता हूं ..

synchronization - Using C# to access OneDrive For Business (Office365) - Can't list subfolders -

Trying to write the contents of my company's users to download "one drive" on the company network so that we can delete them if we can return them I currently use Microsoft.SharePoint I am using .client. I also distinguish OneDrive for Business from OneDrive for the impression (enough to confuse it with Sharepoint). For example ... if my OneDrive url I can successfully list all the files in the root of the documents and download all the files in the root of the document folder. Public Zero List Files () {var Folders = Listfolders (Dirpath, Client Contract, Web); // Now do something with the results contained in 'folders' public listing GetDocumentLibrary (string library name, client contact client contact, web web) {var query = clientContext.LoadQuery (web.lists.Where (p = & Gt; p.Title == libraryName)); ClientContext.ExecuteQuery (); Return query. FirstOver Default (); } Public listing & lt; Folder & gt; Listfolders (String Librar...

r - ggplot2: Shape, Color and Linestyle into one legend -

Image
I want to create a ggplot2-diagram with lines and bars, to see various values ​​y and ybar. Lines are overlapped with dots, which are based on values. There should be 2 legends in the end, a (+ dot) diagram for the line, which includes color, shape and linestyle, and is one for bars, in which to fill the color. According to the Linestyles, dot-size and color according to the variable type (y1 or y2) it works well, as long as I want to set the name and item label for itself: Minimum code for dataframe initialization: Library (ggplot2) library (reshape) df = data. Frames (c (10,20,40), c (0.1.0.2.0.3) , C (0.1,0.4,0.5), C (0.05,0.1,0.2), C (0,0.2,0.4)) Name (DF) [1] = "Square" Name (DF) [2] = "y1" Name (df) [3] = "y2" name (df) [4] = "br 1" name (df) [5] = "bary2" df $ squares & l T; - factor (df $ squares, level = c (10,20,40), label = c ("10m", "20m", "40m")) point, line and Minimum code for...

How to get a CSS selector in PHP? -

I am looking for a way to get a CSS selector in PHP. So say I have a string in PHP like # some [background color: #fff; float right; } // some comment}} # # some # some 2 div # some3 .someclass {float: left; Color: # 000; } Now I want to be able to get all the CSS selectors who have the property float in this case I #some # some2 div # With some3 .someclass as well as #something It is not possible to work with regular expressions because now there is definitely a way to say when the selector is over it happens. Do you have any idea how can I get it? is a library that parses CSS and gives you an object oriented to the CSS file. Method:

ios - Checkmark in a tableview, only one selected -

Hello I know that when you choose this, how to add a tick icon on each line, but you only have one How can I check? - (zero) tableview: (UITableView *) tableview was viewed SelectionRowAtIndexPath: (NSIndexPath *) IndexingPath {[deselecting self.CityTableViewwidthreadpace: indexpath animated: yes]; [Self. CitiTableView setTintColor: [UIColor grayColor]]; UITableViewCell * cell = [tableView cellularoutindexpath: indexpath]; [Self.CityTableView cellForRowAtIndexPath: indexPath] .accessoryType = UITableViewCellAccessoryCheckmark; } This does for every one, but I want to add a new one when it removes the last one and pressed each other. Thanks NSIndexPath * selectedIndex; / Code> Your - (UITableViewCell *) Table View: (UITableView *) Table View CellForAatind Peth: (NSIndexPath *) indexPath {// Start Your Room Here Cell. Secondary type = [index is: selected index]? UITableViewCellAccessoryCheckmark: UITableViewCellAccessoryNone; Return cell; } - (zero) tableview: (...

transform - CSS rotate relative to current position -

I have a spinning wheel graphic set to rotate 0 to 360 degrees infinitely. I should then spin that element in a reverse direction instead of each time with a certain amount, instead of a particular position rather than a position of 0 degree. Put another way, what happens now: wheel is on 5 degree wheel reset wheel 5 degrees back 0 wheel 270 degree wheel reset wheel 270 degree back Runs 0 to And what I want is a continuous movement: Wheel is reset to 5 degree wheel Wheel takes 180 degrees back Wheel 270 degree wheel reset is taken 180 degrees back Any suggestions? We are using the BornBono.OSS library so that the SASS code looks like this: . Spin {@ animation included (3.0 spin linear infinite); } Include {key} (key) {{Add to {change (rotate (0deg)); } {@ Change (rotate (360 degrees)); }}. Include spin-back {@ animation (spin back 3.0 linear infinite); } Include @keyframes (spin back) {change (rotate (0deg)); }} Toggle to click through class spin and spin-bac...

c# - How do I set my project to create the entity-framework context per http request? -

I am using EF6 on the C # MVC5 project. This reference is currently made in Unity Config .cs class, which is called from application_start () in the world to see the use of some unity config class below: Register the public static void () {Var Container = New Unity Container (); BlogSite.Domain.BlogSiteModelContainer Reference = New Domain. BlogSiteModelContainer (); Container. Registration Type & lt; IBlogRepository, BlogRegository & gt; (New injection congestor); } The problem with this is that the database can be updated directly and reference to EF will be inconsistent. So I need to change it so that every time a new http request can be made. I've found that PerRequestLifetimeManager might be the solution for this, however, I can not find any good examples how I should use it. How should I go about implementing it? Or is there a better way? So I have tried some things but have not been found anywhere yet. I realized I could add a container to a Lifetim...

android - Control Emulator from Phone -

If I connect my phone to my PC with a USB connector, then do I call the phone for the emulator as an input device Can I use it? I really want to test the app on my phone and which is shown in my PC and / or the emulator. Thank you!

javascript - Disable HTML5 video download? -

इस सवाल का पहले से ही एक उत्तर है: 14 जवाब आप एक HTML5 में वीडियो? मैं समझ नहीं पा रहा हूं और वैसे भी सवाल में कोई संतोषजनक उत्तर नहीं है मैं वास्तव में आपके बारे में निश्चित नहीं हूँ प्रश्न, लेकिन जो मैं समझता हूं, आप लोगों को अपने html5 वीडियो डाउनलोड करने से रोकना चाहते हैं। ऐसा करने के लिए आप या तो विधि या मेरा उपयोग कर सकते हैं: 2 cshtml पृष्ठों बनायें: पृष्ठ और ओगिव पेज (आपने अपने प्रश्न को asp.net टैग किया है)। इस कोड को पेज में सम्मिलित करें: var अनुरोध = UrlData [0]; अगर (अनुरोध। कुकीज ["अनुमति दें"] = शून्य) {प्रतिक्रिया। रीडायरेक्ट (एचआरएफई ("वीडियो पाथ", अनुरोध + "। एमपी 4")); } और ogvpage में: var अनुरोध = UrlData [0]; अगर (अनुरोध। कुकीज ["अनुमति दें"]! = नल) {प्रतिक्रिया। रीडायरेक्ट (एचआरएफई ("वीडियो पाथ", अनुरोध + "। ओजीवी")); } पृष्ठ 1 mp4 वीडियो की सेवा करेगा और 2 ओजीवी की सेवा करेगा। उस पृष्ठ को खोलें जिसे आप वीडियो चाहते हैं और इस पर अपने वीडियो तत्व को बदलें: & lt; vide...

Arquillian Integration test cannot run with maven only run with eclipse IDE -

I have created some integration tests to test my mask layer. I run my application on Jboss 7 server Integration test is run through Eclipse IDE but when I tried to run on the console with MVN Clean Install , the following exception was shown: java .lang.RuntimeException: new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor not created I used to also be able to work fine with IDE I use Junit. And this is my external dependency section: & lt; Dependency Management & gt; & Lt; Dependency & gt; & Lt; Dependency & gt; & Lt; Group & gt; Org.jboss.arquillian & lt; / Group & gt; & Lt; ArtifactId & gt; Arquillian-bom & lt; / ArtifactId> & Lt; Version & gt; 1.1.1.Final & lt; / Edition & gt; & Lt; Scope & gt; Import & lt; / Scope & gt; & Lt; Type & gt; Pom & lt; / Type & gt; & Lt; / Dependencies & gt; & Lt; / Dependencies & gt; & Lt; / Dep...

openedge - Datatype in progress 4gl -

After the value of the error message is too large to fit into an integer or decimal, the integer and decimal data type only accept 10 digits is. Progress 4GL integer and the maximum dime of decimal datatype Is it possible to print 100 digits after the decimal place in progress 4G? No, it is not possible to print 100 marks after the decimal in progress. But honestly, why would you? If you do not need to do that specific calculation then you can always use a CHARACTER field. Disiaimel Disiaimel data in the digit length 50 points decimals right side 10 of the decimal point Includes up to the digits. INTEGER 32-bit data in a Integre (whole numbers). (integer must be between 2147483648 and 2147483647). INT64 An INT64 consists of 64-bit data (full numbers). (should be between INT64 9223372036854775808 and 9223372036854775807) Note that these are full limitations and nothing to do with the display format of variable / field / widget The display forma...

sql - In Rails, how can you use a .where('rooms.id not in (?), ____), when ____ doesn't return anything? -

कक्षा कक्ष & lt; ActiveRecord :: बेस is_to: होटल में संबंधित है: लेआउट has_many: विज़िट मान्य हैं: नंबर, उपस्थिति: सही पुष्टि: दर, उपस्थिति: सच # मान्यताओं: धूम्रपान, उपस्थिति: सही डीआरएफ़ self.occupied_rooms (से _डेट, टू_डेट) # 24-26 आत्म जोड़ता है (: विज़िट्स)। जहां ('तिथि & gt; =? और तिथि & lt; =?', से-डेट, टू-डेट) .युइनक अंत डीईफ़ self.vacant_rooms (से _date, to_date) self.where ('rooms.id नहीं में (? ) ',' रूम '। कॉक्यूप्ड_रूम (से _डेट, टू_डेट)। चयन (: आईडी) .to_a) अंत डीईफ़ self.find_rooms_with (occupancy_count, smoking, from_date, to_date) Room.vacant_rooms (from_date, to_date) .joins (: layout) .where ('Occupancy_count & gt; =', occupancy_count)। जहां ('धूम्रपान =?', धूम्रपान) अंत का अंत विधि vacant_rooms काम नहीं करती है, जब कब्जे वाले कमरों में कुछ भी रिटर्न नहीं होता है। उदाहरण के लिए, मान लें कि एक कमरा अप्रैल 29 को बुक हो गया है। और हम अप्रैल 28-30 के बीच कब्जे वाले कमरे ढूंढना चाहते हैं। यह कब्जे वाले कमरे ...

charts - Deedle - plotting grouped data -

I want to plot the grouped data placed in the deadli frame. For example, start with: let's fr = frame.off column ["name" =? & Gt; Series [(1, "A"); (2, "b"); (3, "c"); (4, "c"); (5, "c")] "data" =? & Gt; Series [(1, 11); (2, 12); (3, 13); (4, 10); (5, 7)] "Order" =? & Gt; Series [(1, 1); (2, 1); (3, 1); (4, 2); (5, 3)]] | & Gt; Frame.groupRowsByString "name" I would like to chart this chart in some way. Line + chart ends with a consolidation and a conspiracy that will show trends for the grouped series. / P> Is there no box solution in it or do I need to manually unpack the frame in the list of observations? Do I think it correctly that you have a line chart for each group based on the name Want to drag (a line chart for name, i.e. a , a name b , etc.)? In that case, you can use Frame.nest to create a series of frames - the outer chain will be indexed...

c# - Content-files with NuGet are very very slow -

I have a common ASP.NET web application that is shared by multiple sites. I used NuGet to package this general web application and to distribute it on many sites. After this idea:. By doing so, I end up with some issues when updating for a newer version, NuGet actually slows down because of it's cause of 800 content-files Somehow NuGet has to take about 1 ~ 2 seconds for each content-file that needs to be uninstalled, approximately 25 minutes and 5 minutes install to uninstall to do. Especially with TFS-binding. Looking at the source code of NuGet, I thought that the API of Visual Studio is talking to Newgate, it is a hindrance. The whole process 100% CPU-use of Visual Studio So I thought that Visual Studio slow, so maybe I my disappointment can do without it, NuGet are Commands (which runs without visual Studio) only download a package and it opens it will not update the project file because of the fact that some power Script dte ob In terms of connect ... (althou...

linux - OMP Cross compilation with x86_64-w64-mingw32-g++ -

I have a problem with the crosscompling C ++ program which takes advantage of the OpenMP library. I'm using Linux Ubuntu 12.04 LTS. I want to get a executable file running on Windows I have no problem compiling the program with OMP with a regular G ++ command: G ++ a.cpp b.cpp -o OMPres -pg -O3-I./ CBAS / Include -L-LCLAS In addition to this When I try the cross-compilation without OMP, then everything is alright: x86_64-w64-mingw32-g ++ A CPPP BCP-O3-i / CBLS / Evening ./CBLAS/cblas_WIN64.a./BLAS/blas_WIN64.a-o res.exe -l gfortran -static But when I croscipil with it with the OMP Try: Include x86_64-w64-mingw32-g ++ a.cpp b.cpp -O3-I./CBLAS/ ./CBLAS/cblas_WIN64 .a. / BLAS / Blas_Wine 64.AO Operates.XA-L Bluff -STeetic -Fopmomp I get this error: a.cpp: 41: 17: Fatal error: Omp.h: No such file or directory compilation was exhausted. I've found that where the omp.h file is located on my disk, and added the path to the command after executing it: x...

regex - Haskell getArgs changing data type -

I am trying to create a main function for the Haskell module which will take a regular expression from the user and use it for SimplifyRegExp function But it wants the input type RegExp: data RegExp sy = Empty | Epsilon | Literally c. | Or (RegExp SY). Then (RegExp sy). How do I enable a string to type in RegExp? If I load the program on GHCI, then I can call the method directly like the following: * Language Hilix RegxP & gt; SimplifyRegExp (Star (Star A)) 'A' * But I would like to do this so that I can pass the program in a logic at the command prompt and the result will print something like this ( Which does not work at all): main = do n & lt; - GetArgs $ head print (simplifyRegExp (n)) Read can define examples and use it data regEx SY = ... deriving read And then use the readMay import text. Read ... main = Do regexp & lt; - (readMay Head) `fmap` getArgs case's regexp bus r - & gt; ... nothing - & gt; PutStrLn ...

Java: Move Directory containing files and directories to new path -

I have a directory in which there are some files and subdirectories with more files. folder - directory (path - & gt; / home / abc / xyz / folder) - & gt; Abc.txt (file) - & gt; Ax. Zip (file) - & gt; Address (sub directory) - & gt; PWZ.log (file) - & gt; CyZ.xml (file) - & gt; DataLog.7zip etc. What am I trying to do, it takes the entire directory from one path to another, in which all files and subfolders ( And their files). Or move this "folder" to / home / abc / xyz / folder / home / abc / subdir / folder. Does Java provide the API to do this function folder directory or do we need to copy the recursive of only every file on this path? The best method is possibly a recursive method, such as: it is a method that I run into files A temporary folder Private Boolean trick (file sourcefile, file destFile) {if (for SourceFile.isDirectory ()). (File File: sourceFile.listFiles) {This step (file, new file (file.getPath (). Substr...

How do I pass the "T" argument to as a method parameter using Java generics? -

I am using jbis 7.1.3 with Java 6. I'm having trouble finding out what I should do to make my method work properly in the code below "???" Whatever I want to do is to institute an example of my "T" class, every time I start the classroom, I am using Generic Constructor. Below is the method ... Public Class Mayclass & lt; T-abstrum model spreads & gt; {Public void myMethod () {... Last Hashmap & lt; String, string & gt; Data = new hashmap & lt; String, string & gt; (); Last T object = Deviation (???, data); } Private T Received Instances (Last Class & lt; T & gt; Class 1, Final Hashmap & lt; String, String & gt; Data) {T Rate Object = Null; Try {creator CT = class 1. getDeclaredConstructor (HashMap.class); Object [] argList = new object [1]; ArgList [0] = data; RetObj = (t) ct.newInstance (argList); } Hold (exception e) {} // retraction retObj; } // getInstance Here is my Constructor for the abstract model class ....

android - R cannot be resolved to a variable, rebuilding doesn't solve -

Can someone help me? Public class uses Maths4to5Home activity OnClickListener {Personal Button button_4 to5PlayGame, Button_Math Instructions, Button-10 to 5 Scours; Protected void onCreate (bundled saved instenstate) {super.onCreate (SavedInstanceState); SetContentView (R.layout.activity_maths4to5home); // Error Button +05 Play Game = (Button) Find VVBIID (R. Button .05 Play Play); // Error button_mind_display instructions = (button) ViewById (R.id.button_mathsInstructions); // Error Button +05 Scours = (Button) Find VVBIID (R.D.B.ton Butticosaurus); // error I have included a sample of the above code and highlighted where my errors are. I am constantly being told that r is in any variable Can not be solved I have tried cleaning and reconstruction. Apart from this, I have tried to import R (as the quick correction suggests) but then I have been told that in my setContentView () Correct you r & mdash; Specifically, for your project, this is based on what is i...

c# convert string YYYYMMDDTTTTTT to datetime -

इस सवाल का पहले से ही एक उत्तर है: 2 जवाब मैं एक तार तार दिनांक समय के लिए प्रारूप में प्रारूप की तरह है: "20140428132222" मुझे लगता है कि यह YYYYMMDDTTTTT के बराबर है का प्रयोग करें: दिनांकटाइम डीटी; बूल मान्य = दिनांकटाइम। ट्राईपेर्सएक्सैक्ट ("20140428132222", "य्यायएमएमएचडीएमएचएचएमएमएस", कल्चर इन्फो। इन्विरियनटीकलल्चर, डेडटाइमस्टाइल। नॉन, आउट डीटी); देता है 4/28/2014 1:22:22 अपराह्न

php - HTML to Wordpress: Add category block over featured image -

I am currently playing with html, css and wordpress. So far, the site homepage on HTML and CSS has been completely done, so I started porting it to WP. The problem is that I HTML: A class = "category" href = "/ category.html" & gt; & Lt; Span & gt; Category & lt; / Span & gt; & Lt; / A & gt; & Lt; / Div & gt; CSS: .featured-image {status: absolute; Display: Inline; Width: 640px; Height: 100 pixels; Z-index: 0; } .category {font-size: 20px; Color: #fff; Text align: center; Vertical-row: middle; Text-transform: uppercase; Text-decoration: None; Status: Relative; Display area; float right; Width: 90px; Line-height: 100px; Background color: # 555; Opacity: 0.2; Z-index: 1; Word-wrap: break-word; }. Category Duration {Display: Inline-Block; Line-height: 1 AM; Width: 90px; Vertical-row: middle; } I still have WordPress on: & lt; Div class = "post-thumb" & gt; & Lt ;? Php if (has_post_thumbna...

php - Laravel not displaying special UTF8 characters on 'public' server -

I have just started working with Laravel, working with PHP; MySQL is now for some years now, and has just come across a problem which I could not seem to solve. I have a new shop, which I have just built in Laravel, sitting on my development server, my development database. In addition to that I have a CMS system, which is in my own structure, is connected to the public database on my public server. And now I have uploaded my lavarlal yet to the end of my public server store front end connected to the public database. Both developmant front end (Larezel) and public CMS (my framework) both work fine, but display special characters in public front end (larval): 5 The "x 7" magnetic frame shows as : 5â € x 7â € magnetic frame But I'm at a loss, except for the database name, host, user name and environment variable possessing, development and public system There is no difference between. Public CMS system also shows the same letter correctly, so the dat...

php - Call to a member function getElementsByTagName() on a non-object, why? -

मैंने यह कोड लिखा है: फ़ंक्शन GetIds ($ फोरम_आईडी, $ from_page, $ to_page ) {$ Ids = array (); $ Dom = नया DOMDocument (); libxml_use_internal_errors (सही); ($ I = $ से_पृष्ठ; $ i & lt; = $ to_page; $ i ++) {$ dom- & gt; लोड HTML फ़ाइल ('http://www.example.com/forumdisplay.php?page='.$i।' & amp;। च = '$ forum_id); // $ xpath = नया DOMXPath ($ dom); // $ आइटम = $ xpath- & gt; क्वेरी ('// ul [@ id = "थ्रेड"] / li [@id]'); $ आइटम = $ dom- & gt; getElementById ('थ्रेड') - & gt; getElementsByTagName ('ली'); विदेशी मुद्रा ($ धागे के रूप में $ आइटम) {यदि (($ id = substr ($ धागा- & gt; मिलेट विशेषता ('आईडी'), 7))! == गलत) $ आईडी [] = $ id; }} $ आईडी लौटें; } इस फ़ोरम से सभी थ्रेड आईडी प्राप्त करने के लिए, उपयोग के उदाहरण: $ tids = getIds ("67", 1,2); // पृष्ठ 1 से 2 तक सभी आईडी प्राप्त करें। विदेशी मुद्रा ($ डेटा के रूप में $ की गई) {$ file = fopen ("threads.txt", "a +...

java 8 - Java8 equivalent for ruby's each_with_index -

I wonder if there is some stream operation that can be done in Ruby as every_with_index Where the is repeated on the value of each_v_index , as well as index of values. There is no stream operation for that particular purpose, but you can copy the functionality in many ways You can. Index Variable: The following approach works well for sequential streams. int [] index = {0}; Stream.forEach (item -> System.out.printf ("% s% d \ n", item, index [0] ++)); External walk: The following approach works fine for parallel streams, as long as the original collection is supported by random access. List & lt; String & gt; Token = ...; IntStream.range (0, tokens.size ()). For (index -> system out.printf ("% s% d \ n", token .get (index), index);

c# - Passing one parameter of multiple to controller -

I am trying to sort a list while maintaining the current page view. I have created a PageHolver class and sortellar class to do this. The problem is that instead of passing only the parameters, the controller needs it to be passing the whole end of the URL. How can I root it so that the correct parameters are passed? sorthelper.cs: public static MvcHtmlString PageSort (This is HtmlHelper HTML, string LinkText, string sortOrder, string category, pagingInfo paginginfo, fx & lt; int, string & Gt; pageUrl) {// Model Referee Number of pages to get paging in. StringBilder result = new stringbilder (); {// href Tag Builder Editor per Page = New Tag Builder ("a"); // a & lt; A & gt; Tag tag Merge author ("href", "? Sort order =" + sorted + page url (paginginfo.sink page)); Tag INHML = link text; Tag.AddCssClass ("selected"); Result.Append (tag.ToString ()); } // Dynamically creates links - href + pagenumber = URL returns as strin...

c# - Using JSON.NET to return ActionResult -

I am trying to write a C # method that will serialize a model and return a JSON result. Here's my code: Read public actions ([DataSourceRequest] DataSourceRequest request) {var items = db.Words.Take (1) .ToList (); JsonSerializer settings JsSettings = New JsonSerializer settings (); JsSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; Var changed = JsonConvert.SerializeObject (item, blank, jsSettings); Return Jason (Converted, JasonRakweit Behavior AloGuget); } When I read in Word / Chrome, I found the following JSON result: "[[WordId \": 1, \ "rank \ ":", "\", "\", "\", "\", "\", " "ArticleIf" -97ef-4a99-b324-a160295b8ac4 / 1 / sixty_vocab_click_button.mp3 \ ", \" LangID \ ": 1, \" CatId \ ": null, \" isActive \ ": false} I think that \ "saved quote is a problem that occurs when you sort the object other From the questions: ...

node.js - Middleware to validade all form entries express js, node js -

Is there some middleware function for validating all the entries for JS and expressing JS? I want to check special features and I do not want to validate every form field every time. Thank you! It may be a good fit, it is built on a popular recognition library. Express-Accredited is also there. 1 set up and init expressValidator = is required ('express-recognizer'); App.use (expressValidator ([options])); Configure verification '). NotEmpty (). IsInt (); Req.checkParams ('urlparam', 'invalid urlparam'). IsAlpha (); Req.checkQuery ('getparam', 'get meet invalid'). IsInt ();

mysql - Python MySQLdb change string encoding -

I believe Python does not play well with the character encoding of a column in the SQL table: | Column | Varchar (255) | Latin 1_swedish_c | Yes. | Faucet | Choose, insert, update, reference | Shows output for this column above. Thus is varchar (255) and encoding is latin1_swedish_ci. Now when I want to play Python with this data, then I'm getting the following error: word = gs.corpora.Dictionary (tweets ) File "/usr/local/lib/python2.7/dist-packages/gensim-0.9.1-py2.7.egg/gensim/corpora/dictionary.py", in line 50, in __init__ self.add_documents (document) The file "/usr/local/lib/python2.7/dist-packages/gensim-0.9.1-py2.7.egg/Gensim/corpora/kun.py", line 97, add_documents _ = in self.doc2bow (document , Allow_update = true) # Do not ignore the results, we only care to update token id "/ usr / local / lib / python2" 7 / dist-packages / gensim-0 9.1-py2.7.egg / gensim / corpora / dictionary.py ", line 121, doc2bow document = sort...

Android get device locale -

After installing my Android program I check the device locale: string Device locale = locale. .getDefault () getLanguage (); If deviceLocale is inside my supported languages ​​(English, French, German), then I do not change the locale. But for example, if I do not support the device's language: for example Spanish. I set the existing locale in English, because most people can understand English to some extent. Locale Locale = New Locale ("N"); Locale.setDefault (location); Configuration config = new configuration (); Config.locale = locale; PContext.getResources (). Updateconfiguration (config, null); But after that, in other ways, when I check the device's locale like this: string device locale = locale.gate default ( ). GetLanguage (); I get the result as "English" but the location of the device is Spanish What does the language () give to the current app's locale? How can I get the device's locale? EDIT: In the first ...

javascript - JQuery Mobile Events + RequireJS -

I want to use this plug-in with RequireJS I have tried to follow this example and I You can use, but not the plugin. Can someone give me an example with requirejs.config, defines jquery and jquery mobile plugin with a utility function from plugin and plugin? I tried to do something like that, but it does not work: // app.js (requirejs.config) requirejs.config ({"baseUrl": "js", "paths" : {"Jquery": "libs / jquery", "plugins": "libs / plugins"}, "shim": {"plugins / jquery.mobile_events": ["jquery"]}}); Requirejs (["Example"]); Define //example.js (define with utility function) (["jquery", "plugins / jquery.mobile_events"], function ($) {$ (function () {var tester = $ ('# tester') ; Tester .mobile_events () .doubletap (function () {console.log ('' doubletap '' ';');}); // line 4, see output browser log}};}); // html &...

programming languages - How to write a loop with only if-else? -

Someone once told me that you can do any programming functions with only -Are statements. I want to know: Is this statement correct? (My understanding depends on the ability of the loop with typing-perfection and if / does not complete any turing) Is it possible to write a loop only with the details? How would you loop through this if only other? ["Fruit", "Car", "Water"] Engineer for a recursive on the opposite If the recitation is the process of repetition of objects in a self-similar way - Calculating Fibonacci numbers is a great example to understand the rearrangement (the simplest and trivial example). Public Entity Fibonacci (Int N) {If (N & T; = 1) returns N; Return the second Fibonacci (N-1) + Fibonacci (N-2); } But there are some disadvantages of recycling in most popular programming languages: (A) It is slow on large iteration and (b) uses a lot of memory for the performance pile. So, yes, it is possible to write ...

haskell - How is function parameter defined? -

For this function: plus1 = (+) 1 I can use it: prelude & gt; Plus 1 3 4 Plus 1 type plus1 :: integer - & gt; Integer How is the function parameter integer being allowed here? In my function definition where the integer function parameter is defined? I'm not sure what to expect from me but all the parameters coming from Java need to be defined as part of the law, but does it feel like going behind the scenes here Used to be? (if we ignore the num typeclass for a second and The excuse that only works on integer s to work), (+) is a type of function -> (Integer -> integer) (parentheses are not required because -> is correct, but I've added them for clarity). This means that the argument of integer type and one type of type does -> So when you apply (+) to the integer 1 , you actually get one of its functions as the result type Since the add1 holds, it is a type of task integer - & gt; Integer and this is th...

sorting - iOS - Sort NSDictionay keys by sub value -

Image
itemprop = "text"> I have an NSDictionary as the key code in the form of a currency and containing a NSTTIR (currency name) as the value One NSDAS + one NSRI (list of coins): The goal is to sort NSDL with name-value to get NSARR with currency keys (AED, ARS, ...). I know how to sort by keys and values, but it does not know how to sort an NSDictionary inside a value. The following gives me the NSArray sorted with values, but I lose the keys: NSMutableArray * dictValues ​​= [[Self.currency All Values] ; [Sort by using leopardsCommunication: (NSCSpamator) ^ (NSDriver * A, NSustroyation * B) {nssting * key1 = [objectfork: @ "name"]; NSString * key2 = [B ObjectFor: @ "name"]; Return [compare key1: key2]; }]; The key to convert a dictionary dictionary The key to inserting the key into the dictionary is the first step in the dictionary of the dictionary without losing anything. In other words, you must change this to root AED name ...

jsf - Dynamic bean properties for EL by implenting java.util.Map#get -

I have a @session squid bean which I would like to use as a map so that I can use my properties EL Can I do this by implementing java.util.Map to implement the view object (object o) with my application logic. Throwing an unsupported exception to all other accelerated map methods. @ session: SCOXED @ Nominated Public Segment MyBean Apply Map & lt; String, string & gt; {@ Override Public String (object's) {// Application logic here} @ Override Public Boolean (object's) included (new unsupported operation expansion); } / / All other map methods are included as overrides. Key} Properties are read only and I only need to use the method obtained from my code, Is not it safe to implement? Is there a better way of defining dynamic properties for EL in the bean? It would be better to store this map as a session attribute, so you should get a @ sessioncached Beans need not be made and it can be accessed through the language of expression without problems. Pu...

sql server - T-SQL Delete half of duplicates with no primary key -

In T-SQL stored methodology, I have a complex process that compares data using floating tables, but at the end of everything. I return a single table, which ends with two rows. All the columns in the row in these lines are exactly the same and there is no primary key in this table. I just need to remove half of those that are based on the number of the row. For example, if there are eight rows all the same values ​​I want to delete four out of them. There is no way to get rid of them through my SP filtering because the data that has been entered is actually a duplicate of the information entered by the user, but I need half of this information. I have done some research on this subject and have done some tests, but it seems that it is not possible to remove half of the repeated lines, is it not possible? Or is there a way? Here's a way, using a great feature of SQL Server, updating CTE: todelete in the form of todelete (select t. *, Row_number ()) (by col1, col2, col3 by...

Java send image from client to server -

I want to do a short programming coding and I want the client to take the printer screen and then the image that is connected to the server is . Customer code is not the same. Public run zero () {while (true) {rectangle screenRect = new rectangle (Toolkit.getDefaultToolkit). GetScreenSize ()); Buffer image printscrine = robot.createcrescapture (screenrext); //What do I do here?!?!?! Try {Thread.Sleep (2000); } Grip (Interrupted E) E. {// TODO Auto-Generated Catch Block e.printStackTrace (); }}} and here is the server code run public zeros () {while (true) {// read the image sent from the client // sleep Dirt {Thread Soul (2000); } Grip (Interrupted E) E. {// TODO Auto-Generated Catch Block e.printStackTrace (); }} Hope you can help me I have tried Google to get my answer, but there are some things that I really can not understand. I have seen people transforming the image into an array of bytes. Why do you have to do this? / P>

c - Cannot get input from user to work in place of manual strings entered in code -

I'm trying to run a program that basically takes an input string and it's through some code Sends and lists it according to the linked spectrum I thought how to do this by using manual (actual code) text input, but when I'm trying to take input from the user, I do not work it can. #include & lt; Stdlib.h & gt; # Include & lt; Stdio.h & gt; #include & lt; String.h & gt; Structure list {char * value; Structure list * next; }; Compare Int (structure list * one, structure list * 2) {return SRCMP (one-> values, two-> value); } Add zero (structure list ** pp, four * value, int (* CMP) (structure listlist * l, structure listlist * r)) {struct list * new; New = maulok (size (* new)); New-> value = value; (; * PP! = Faucet; pp = & amp; nbsp; - PP) - & gt; Next) {if (CPP (* PP, new)> break;); } New-> gt; Next = * pp; * PP = new; } Zero performance (structure list * ptr) {for (; ptr! = NULL; ptr = ptr- & gt; next) {printf (...

jquery - change from horiozntal scroll to vertical when mobile -

My website is responsive, given a laptop, it is given horizontal navigation but when the mobile was met I I would like to change the same scroll animation, but going vertical ... & lt; Script & gt; $ (Function () ($ ('. Nav a'). Bind ('click', function (event) {var $ anchor = $ (this); $ ('html, body'). Stop (). {ScrollLeft : $ ($ Anchor.attr ('href')) Offset (). Left}, 500); event.preventDefault ();});}); & Lt; / Script & gt; The website is www.niklaskoskela.com I know that I need to provide something else. 'A', 'A', 'A', 'A' Anchoroffset.left, scrollTop: anchoroffset.top // and .css media queries : @ media all and (max-width: 1024px) {#one, # Two, #three {float: none; }}

css - How to make one div over two div's only for mobile devices -

I'm just trying to create a simple page for mobile devices. The header is text, then the text is at the top, the bottom and the phone's image, which raises the text (top and bottom). I have tried to get it from Twitter Bootstrap, but my result was not very good, maybe because I do not understand overflow in CSS. So I'm trying to achieve it: And here you can see what's happening: or you can check many ugly codes here: & style; Style = "text / css" & gt; .textp {padding-left: 15px; } & Lt; / Style & gt; & Lt; Link href = "css / bootstrap.min.css" rel = "stylesheet" & gt; & Lt; link href = "// netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel = "stylesheet" & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div style = "position: relative;" & Gt; & Lt; Div class = "line" style = "background color: # E4F6FC;"...

ruby - Rails Custom Validation With Request Params? -

Rail Nab, I am trying to write a custom verification, Depending on what I have from this post request - in this post model, I want to make sure that no user was already posting on a topic, but to do this I must have a topic ID from the post request Should: Class Post & lt; ActiveRecord :: Base ... Valid: user_already_posted, on :: create def user_already_posted Subject = Subject: where (id: params [: topicId]). First / some code that runs on the subject user and ensures that the user is not, however, I have learned that the parameter is not global and the model can not access it (I finally used Laurel, where this is not the case , So this is confusing to me). Are not Custom Ideas Required? Do I need to keep track of filters or do the controller perform valid work of my own? I think you're doing a bit of a design problem here. You are creating a post verifier, but the verification itself is not about the post example. I mean, the ideal verifier has all the po...

php - How do websites validate username and passwords and obtain data? -

I have a question that is more conceptual than any moment. My status here The school I go to, has a website to look for grades, which can be found on this link: The login page presents the username and password box I plan to create a simple iPhone app that lists the resulting grade and displays them in the UITWview . How, though, can I get the data from this website? How to validate the websites (certified) and then pass on the relevant data? Thank you for being influenced by this difficult question. There are many things going on this website; I think we will need a bit more information on your specific request. When you say valid, do you consider valid as a check that the user name and password are formatted correctly or do you validate that the validation is valid, i.e., the resulting data in X Send that username and password are correct. I see that I can partly answer your question, the ASP sends SSL, username and password to the site application, where...

node.js - Node + express session data -

I am working with this boilderplate, which is the user using Express-session, Mogostore for session management . The node document made for each session looks like this: {"_id": "QDKVO5GM6GrNYd0SlQyTgJsx", "session": "{\" cookie \ ": True, \ "path \": \ "/ \"}, \ "passport \": {\ "originalMaxAge \": null, \ "ending \": null, \ "only Http \": { \ "User \": \ "535e005c02d3c0ed79463583 \", \ "_Csrf \" \ "\": \ "MqLJJ8qZLSk5 / w == \", \ "return \": \ "/ \", \ "flash \ ": {}}", "Expired": {"$ date": "2014-05-12T08: 27: 04.696Z"}} is there any way Can I add data to each session? Sense data is used to store them. Thanks, You can add properties, and therefore data, session variables in the same way that you can do in any JavaScript object. If you type exp...

php - Set a non-default schema in Yii Framework with PostgreSQL -

I am using the Yii framework with PostgreSQL and I need to create new models in a non-default schema. How can I do that? I tried the following: Protected / Component / PgSchemaConnection.php class PgSchemaConnection Extended CDbConnection {secure function initConnection ($ pdo) { Parents :: initConnection ($ PDO); $ Stmt = $ pdo- & gt; Prepare ("set search_path master, public"); $ Stmt- & gt; Executed (); }} protected / config / main.php return array (... 'db' = & gt; Array ('ConnectionString' = & gt; 'pgsql: host = localhost; dbname = bsc', 'username' = & gt; 'aUser', 'password' = & gt; 'apes', 'charset' => ; 'Utf8', 'class' = & gt; 'PgSchemaConnection'), ...) But when I run in the console Gt; & Gt; Model Fu WARNING: Database 'Foo' table does not exist. Model Generated / relatedobjective.php PHP Warning: For the foreach (...

class - C++ trouble with using a member function as an operand. error C2679 -

I can use some help! This is my first course in the coding of any kind and I 'I hit my first big wall, it is with C ++ Classes I to my problem row main.cpp 1: Error C2679: Binary '=': No operator found which operates the right hand of "zero" (or no conversion is acceptable) My problem is that as simple as that, I have to find out that my qualitative work is applicable Why is the operation done so that I can continue my programming! One way to note, if this is wrong then do not worry about my "result" function, because I'm still in the process of tinkering around it. Thank you for your time. fraction.cpp #include & lt; Iostream & gt; #include "fraction.h" using namespace std; Fraction: fraction () {top = 0; // default constructor below = 1; } Excerpt: fraction (int fraction, in the dynamizer) {top = fraction; Down = bottom; } Zero point: Answer () {top = numAnswer; Down = denenser; } Zero excerpt: print () cons...

Conversion from GUID to file? -

I have some rhetorical questions, is it possible to do a rollback with a GUID where a directory structure files are located? The background is that we are using an administrative tool for such cases where documents are registered and added on a daily basis and each time the document is given a unique GUID, the next time When you search for a specific document, then search will throw a GUID link to that particular document. There is a problem now. Say that anyone needs all the documents in a particular case. Search will throw a link to each document, sometimes more than 100, you will click on the link till the insanity. I would like to know whether it is possible to find out where all the documents in the directory structure are for a particular case, then I have a cp * / my / choice / of / location I can execute. Can this be done?

python - Cross-tabulate timestamp for two tables in ArcGIS -

I am trying to solve a problem in ArcGIS 10.2 and I would like to complete either Python or here The need to use a SQL statement is to work. I have three datasets: - A polygon grid with a unique ID - A point feature represents class (A) GPS data with a time stamp and a GPS unit-A's ID number Point feature is collected in every 3 seconds (B) represents a specific event with a timestamp and ID What is the grid feature table showing what I want to show The old GPS ID (A) was there with 30 seconds of an event (B) which was in the same grid There can be several events in each grid, so in 30 seconds of each event of that grid A closer unique GPS ID will be required. Can anyone point help in the right direction? I only have basic Python and SQL experience.