Posts

Showing posts from July, 2011

asp.net mvc 2 - Refused to display 'https://mytestwebsite.com/?wa=wsignoutcleanup1.0' in a frame because it set 'X-Frame-Options' to 'DENY' -

I have been developed by asp.net mvc2 and SQL Server 2012 as an authentication process for applications that have ADFS 2.0 I am using. In order to solve this issue: ClickJacking (aka cross-site framing or XSF), we have set x-frames-option with Price Denny in the web-config file. Reproduction Steps: 1. Log in using the Chrome browser application using valid credentials. 2. The system showed me the app landing page. 3. Click on F12 to open Developer Tools option. 4. Now the Signout option was clicked and navigated to the console window. 5. The system has displayed an ADFS signout page, but I am still getting an error in the console window as explained below: Because the refusal to display '' in one frame This 'x-frames-option' sets 'denny' On checking the view surs of the ADFS Southeast page, I came to see the following: Can someone tell me the best way to solve the above issue? One option is to do nothing Important part of sign-out cleanup au

Mailgun having trouble dealing with attachments PHP -

I am currently connecting with mailguns in the webhocks so that I sent it through any e-mail and it is somewhere else Can pass I have been successful in dealing with APIs and body inputs, but I am currently having trouble catching any attachments in an email. Melgun says that he is a multilayer file, but I have tried to capture it and write information in a file, but it comes back as a blank table ... < Pre> $ file = fopen (__dir.c '/ files) txt', 'w') or die ("can not open the file."); ob_start (); var_dump ($ _file); Fillit ($ file, ob_get_clean ()) or die ("can not be saved in file."); Fclose ($ file); Within the information of the post, I get an attachment parameter, which contains things like URL, content-type, name etc. I have tried to go to the URL of each attachment, but I ask a login box for a username and password and say "the server says: MG API" I have no idea that I need to pass some , So I can get the attach

javascript - nodejs events is being called multiple times -

I am working on a CMS, which is hosted nodes. Here I have added some hook hooks. > mpObj.emit ('MP3 Footer', 'Center & gt; MPTEST plugin was successfully loaded. & Lt; / center & gt;'); When I handle this event here: mpObj.on ("MP: footer", function (str) {console.log ( Str); if (str) {httpResponse.locals.siteFooter + = str;}}); This is being executed several times in 1 page. Patterns as follows: If the page loads for the first time, it will be executed once. If the page completes the second time, then it will be executed twice. If the page is full of EN, it will be executed annually. Please advise. I do not know how your CMS works, but I think the listener is registered multiple times Used to be. mpObj.off ("MP: FOOTER"); or try adding the related function to your CMS before mpObj.on () call.

Working with javascript method -

मान की तरह '4,3' प्राप्त करने के लिए मेरे पास यह है: var मान = Objeto.row (4) .cell (3); जेएस विधि को विकसित करने के लिए सही फॉर्म क्या है? मुझे लगता है कि मुझे ऐसा कुछ करना है: फ़ंक्शन ओजेटो (पंक्ति इंडैक्स) {सेल: फ़ंक्शन (सेलआईंडएक्स) {वापसी पंक्ति इंडेक्स + ',' + सेल इंडेक्स; }} मुझे पता है कि यह काम नहीं करता है, यह केवल अनुमान है धन्यवाद ... यदि आप पदानुक्रम रखना चाहते हैं जहां कोशिकाएं पंक्तियों से संबंधित हैं, तो आप यह कर सकता है: var objeto = {पंक्ति: फ़ंक्शन (पंक्ति इंडैक्स) {रिटर्न (फ़ंक्शन (पंक्ति इंडैक्स) {this.cell = function (cellIndex) {return rowIndex + ',' + cellIndex; }; वापसी {सेल: this.cell}} (पंक्ति इंडैक्स)); }}

tizen wearable sdk - How does an android app knows about a Samsung Gear? -

I want to know from my Android app, if a Samsung Gear is configured by the user who can connect or No At the moment I use this code, which is less bad: If the user has installed Samsung Manager, then I think he also has a Samsung Gear: PackageManager Pm = context.getPackageManager (); Try {Pm.getPackageInfo ("com.samsung.android.gearmodule", PackageManager.GET_ACTIVITIES); Back true; } Hold (PackageManager.NameNotFoundException e) {return false; } There are good documents related to the SAP protocol. - There are some resources that can help you check "helpful" items Sample applications are useful

c++ - about operator overloading -

My professor asks me to ask which operators can not overload C ++ and what is the reason for this. I found that dot (.), Scope resolution (: :), conditional (?), Size () operators can not be overloaded. Can anyone tell me the reason for this? struct troll {int money = 0; Int problems = 0; Float cant_touch_this = 0.0; Integer & amp; Operator (const std :: string and member_name) {if (member_name == "money") return problems; And if (member_name == "problem") refund; And if (member_name == "cant_touch_this") cant_touch_this; And throw 0; }}; Int main () {TrollT; T. Money = 42; T.problems = 3; } The above snippet is not compiled correctly while typing , I asked myself a lot of questions: what What parameters should this take? How do I handle cases where I throw? Why do I need a runtime overhead to evaluate the compiled time member? Will other developers be relieved by switching my members with my developers? This list may proceed

Pattern order sensitivity in grep -

I am running with grep in some very strange behavior, which I could not understand. I am trying to filter common words from a file of a word, but grep is ignoring some patterns based on my order. Here is a minimum example that shows a failure: Test file: Once it result from the command: Cat test.txt | Fgrep -v -w -e 'an' -e 'the' -e 'a' -e 'that' foo bar < Results from the P> command: cat test.txt | Fgrep -v -w -e 'a' -e 'a' -e 'that' -e 'the' foo once I can not find any address that grep should show such sequence sensitivity, and obviously this is a serious problem when I get to the actual information and filter lists. My suspicion is that this is actually a bug in the installed version of grep - I'm running on MacDon Mavericks, and could not reproduce this bug on Ubuntu machine. I have answered my question: This is a bug in the version of grep that is distributed by applets. (Due

Where is Domino Designer Java agent template stored? -

I'm surprised that the new java agent gets the code generated by the DOMINOZ Designer template ? import lotus.domino *; Public Sector Java Agent AgentBase {Public Zero Notes Man () () {Sessions session = getSession () tries; Agent Contact AgentContax = session.getAgentContext (); // (your code goes here) hold (exception e) {e.printStackTrace (); }}} I thought it was our corporate standard to make it editable ?? | These code templates are controlled in prerendex / java / code style / code templates. i actual location your / workspace Is going to mess in. You can import and export the code template there. I will just keep my standard template somewhere else on a file server and ask the developers to import it. It is theoretically possible to do this in something else brilliantly, but it is probably uneven because no one is guaranteed that the files will always be saved in one place.

How do I add style and html to flash error message in my controller in Rails 4.0 -

मेरे पास यह UserController.rb def बना है @ यूजर = User.new (user_params) अगर @ user.save sign_in @user flash [: सफलता] = "टर्नकी में आपका स्वागत है!" redirect_to @user # सफल सहेजने का संचालन करें Else redirect_to signup_url फ़्लैश [: त्रुटि] = @ उपयोगकर्ता.र्रॉर्स.मेटी? ? "त्रुटि": @ यूज़र.ररर्स.फुल_एमसेज.ट_सेंटेंस एंड एंड कोड अभी काम करता है, लेकिन मैं अपने फ्लैश त्रुटि संदेश में कुछ स्टाइल जोड़ना चाहूंगा, यह सिर्फ ऊपर दिखता है पृष्ठ के ऊपर 1 वाक्य में नंगे पाठ के रूप में। मैं वाक्य को न दिखेगा, लेकिन मैं इस और सिमेंटिक टैग के लिए कुछ स्टाइल भी जोड़ना चाहूंगा। वर्तमान में यह पृष्ठ पर एक & lt; div class = "alert alert-danger" & gt; त्रुटि वाक्य यहां & lt; / div & gt; मैंने शैली की कोशिश की है कि मेरे सीएसएस में, लेकिन इसकी रेंडरिंग नहीं है मुझे फ्लैश मेसेज के लिए इस तरह से कुछ करना होगा (या समान) flash [: error] = @ user.errors.empty? ? "त्रुटि": & lt; h1 वर्ग = चेतावनी-खतरे & gt; @ उपयोगकर्ता.ररर्स.

Adding VM /etc/host entries that point to host machine with Vagrant and Puphpet -

I know that to add entries to the host's / etc / hosts file, which points to VM, But I'm actually trying to find a dynamic way to move in the other direction. On my machine, I have installed MySQL with a large DB. I do not want to put it inside VM, I need VM so that it can be accessed. I can easily set it up manually. After being elated, I joined V.M. I can do SSH and edit / etc / hosts there and create an entry like hostmatchine and can point at my IP address on time. However, as I move my host machine from home to work, I must update that entry. No one Is there any way inside the ARB file or to create a passionate way to create such an entry in the IP host machine and VM host file? One way to do this is to do this. Since warranty file is a ruby ​​script, we can use some logic to find local hostnames and IP addresses. Then we use those simple script in a script that adds them to the guest / etc / hosts file. Example Vargrantfile : To set host IP address,

java - Selenium database test fails when executed using ant script -

I have a Selenium WebDriver test that connects to a database, executes queries and values ​​stored in the string Does. Then I do stuff with that thing When I execute the test in Twist (based on Eclipse) this test works fine. But when I execute the test using an ant script, it is also seeing that the faucet indicates the exception is failing. [Twist.runner] java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc SQL LarsworthDrive Code Snippets: Verify Public Zero user-verifiedTTLUser profiles and subscriptions () throws an exception {string user information = products. VerifyTrue ("Manually did not match user details in the subscription table, check manually", userDetails.contentEquals ("1215401")); } Verify public static strings Subscriptions to the devices () throws IOException, SQLException {String userSubscriptionDetails = null; DBAccess.getConnection (ConnectionStrings.databaseConnect ("Authentication"), ConnectionStrings.getLo

android - AlarmManager doesn`t start BroadcastReceiver -

I'm trying to use a broadcast receiver and alarm manager to set a shot alarm. I do not know why this is not working. What am I doing wrong? I have no exceptions, there is no log, there is no suggestion from the IDE, everything is fine, but sometimes the method received in my broadcaster is never called upon. Public Zero Set Alarm (Reference mContext) {AlarmManager alarmManager = (AlarmManager) mContext.getSystemService (Event .ALARM_SERVICE); Intent = intent (mContext, alarm receiver class); Pending pending vertical anticipated = pending content. Treadbork (mContext, 505151550, intent, pending provider. FLAG_UPDATE_CURRENT); Calendar cal = calendar.justinstance (); Cal.add (calendar. SECOND, 20); AlarmManager.Set (AlarmManager.RTC_wekup, cal.getTimeInMillis (pending, Pending); Log.d ("alarm", cal.getTime () toString ()); } I'm calling it from the activity: New MyManager (). SetAlarm (this); But I have also tried: New MyManager (). SetAlarm (MyActivity

mysql - How to Insert a query into two diff table vb.net -

I'm having trouble entering an item from two different tables using vb.net and MySql This is the item table and the stock table in a single query: New ADODB. Rikesset rsitem.CursorLocation = ADODB.CursorLocationEnum.adUseClient rsitem.CursorType = Insert as ADODB.CursorTypeEnum.adOpenDynamic rsitem.Open in rsitem ( "items, not stock items = '" & amp; txtItemNo.Text and amp ;;' ', Description =' & amp; txtDescription.Text & amp;; '', value = '' & txtPrice.Text & amp; "', brand =' '& amp; txtBrand.Text & amp;; stock_on_hand = '' & TxtStocks.text & amp; "'", cn) My problem occurs when I type in the input box TxtStocks.text mysql from my vb.net Whatever input does not show in DB, I think I have a wrong query. Can someone help me. First you need to make sure the text boxes are not empty Then its related to rsitem.Open , I saw you opening it twice Thi

css - New to Bootstrap - I have a goofy grid puzzle to solve -

I am learning bootstrap and have a puzzle for you ... I am trying to create a grid layout that sequence In the following pattern, I am having trouble pulling and pulling classes in the right way. I will include my code but I am afraid that it is far from the solution that you may laugh about here What I am doing: In medium / large desktop: small: x Smaller: [A] [A] [A] [B] [B] [1] [C] [1] [2] [B] [1] [2] [3] [C] [2] [ D] [D] [C] [E] [3] [4] [3] [F] [E] [D] [4] [5] [6] [F] [4] [5] [6] [E] [5] [F] [6] Any help with this would be greatly appreciated! It is not possible even with push and pull you do not "leave" other divisions I can do it best if I can: & lt; Div class = "col-xs-12" & gt; A & lt; / Div & gt; & Lt; Div class = "col-xs-12" & gt; B & lt; / Div & gt; & Lt; Div class = "col-xs-12" & gt; C & lt; / Div & gt; & Lt; div class = "colonel-xs-12 col-sm-6 col-md-3" &am

r - can't pipe with magrittr Error in eval(expr, envir, enclos) : could not find function "%,%" -

I am using Magritr to use new piping functionality, and when I use the% & gt;% I can, I use%,%. I tried the example below in response to I get the error error in evpl (expr, envir, enclos) : "%,%" Can anyone do something that can paste the source code just to work so that I `%,% & lt; In any way. I am just trying to use the paste function with several arguments, for example i are want to change the day. time (as.numeric (paste (str_sub (Sys)), 1,4), str_sub (Sys.time (), 6,7), str_sub (Sys.time () , 9, 10), sep = '')) with str_sub (Sys.time (), 1,4)%,% Str_sub (Sisktaim (), 6,7)%% Str_sub (Sisktaim (), 9,10%) & gt;% paste (Sepp = '')% & gt;% Asknumerik () Avl error (expr, envir, enclos): function "%,%" but instead I paste (str_sub (Sys.time (), 1,4), str_sub (Sys.time (), 6,7) , Str_sub (Sys.time (), 9, 10), sep = '')% & gt;% as.numeric () [1] 20141008 Any help? An example function I k

javascript - ES6 modules + Gulp -

I need to create a bundle, an app example written with the es6 module: Import APIs from APIs; Function loader () {// some code which user API}; Export default loader; Develop a version that converts AMD into GUD-AS 6-Module-Transpolar and needs to work well with those. But I can not find a way to make bundles with this: I am trying to make the GLUP-AS 6-module-tripler and gull-browser: gulp.task ('build_js', function (gulp.src ('app / ** / * .jsx') .pipe (gulp_react ({errLogToConsole: true})) .pipe (transcriber ({type: 'cjs'}) .pipe (gulp.dest ( '.' '+ Build_fld +' / '));}); Gulp.task ('brow', ['build_js'] function () {gulp.src ('dist / auto-name.js') .pip (browserfile ()) .Pipe (gulp.dest ('./' + Build_fld + '/'));}); But there is an error in my browser: Error: module 'name' did not match 'd: \\ function \\ lib.react-suggest \\ districts \\ fake_32525252.js'; But g

how to simplify this statement? php mysql -

I need to retrieve many selections from the mysql table, I need to make the statement easier This is my statement $ starard = dateelect $ enddate = dateelect select SELECT count (different (customer)) my_table as a customer where 'date_field' between '$ startdate' and ' Enddate 'SELECT count (different (customer)) as computer 1 my_table where computer = 1 and date_field between' $ startdate 'and select' $ enddate 'count (different (customer)) as computeris2 where my_table compute I have around 10 fields, each with 4 or 5 values ​​(option) in each field (such as a computer), between 'r = 2' and 'date_field' between '$ startdate' and '$ enddate' Want to count specific customers and all between 2 dates The other problem is that this date is the timestamp of mysql, it does not return true and does not exclude today's record, unless it does not select the date of tomorrow, it works , I think that this

Redirect http server request in Dart, but uri.host is blank -

मुझे मिला है: server.listen ((HttpRequest अनुरोध) {प्रिंट ( Request.uri.toString ()); अगर (request.uri.host == "woven.app") {request.response.redirect (नई उरी (योजना: 'http', होस्ट: 'बुने.को', पथ: Request.uri.path, fragment: request.uri.fragment))}} लेकिन लाइन 2 रिटर्न रिक्त है request.uri के नोट के अनुसार : * प्राधिकरण घटक का मेजबान भाग लौटाता है। * * यदि कोई प्राधिकरण घटक नहीं है और * इसलिए कोई मेजबान नहीं है। < P> अद्यतन करें: यह स्थानीय रूप से और सर्वर पर, क्रोम के साथ परीक्षण किया गया है। यह ठीक से देता है होस्ट नाम: request.headers.host यह काम क्यों करता है जबकि request.uri.host नहीं करता है?

php - How do I unit test the view path? -

I have a redirection process if a valid check fails, then redirect the user to a specific page. If a valid check passes, load a view. In my unit test script, I am using Laurel's own unbreakable redirects, on the unsuccessful process, which works fine: $ this - & Gt; AssertRedirectedTo ('those / create'); However, I want to know that if it passes then the view presented is user / index - it is not a redirection, So I want to check the path of approach to make sure this is correct. There can be no way to see me back in this way. Currently, I test against the title ', but I think it will be redundant, because the title can change in the future, and in that regard, the examination should still end. about something like this: $ response = $ This- & gt; Call (...); $ View = $ response- & gt; Original; $ This- & gt; AssertSame ('user / index', $ view-> getName ()); Similarly, you can use getPath () etc. on example.

wpf - Windows Phone 8.1, How to bind style to view? -

I've written a style for the button. Unfortunately, I had to face a problem: the font size of the button depends on one value, which I use in the only view (in particular, this DisplayInformation stuff) I can count on Ideally, I will do the following: & lt; Style x: key = "MyStyle" basedOn = "{StaticResource SomeStyle}" TargetType = "Button" & gt; & Lt; Setter Property = "FontSys" value = "{binding element name = root control, path = some property" /> & Lt; / Style & gt; Then, I only provide the necessary properties in the visual category. How can I solve this problem? Specifying the bond in the setter value is not supported in the Windows runtime (supported in WPF and Silverlight 5 Maybe, though). If you are a Google near work, then you are working, but they are like Hank. See, which uses the attached properties and the binding assistant class.

Parsing JSON Object in Java -

मेरे पास JSON वस्तु है: member = "{interests: [interestkey : कुत्तों}, {रुचि के: बिल्लियाँ}}} "; जावा में मैं ऊपर jsonobject को पार्स करना चाहता हूं और सरणी सूची में मानों को संग्रहित करना चाहता हूं। क्या कोई मुझे कुछ कोड स्निपेट प्रदान कर सकता है जिससे मैं इसे प्राप्त कर सकता हूं । धन्यवाद मैं मान रहा हूँ कि आप में रुचियों को स्टोर करना चाहते हैं सूची। लायब्रेरी का उपयोग: JSONObject obj = नया JSONObject ("{रुचियां: {{हित के: कुत्ते}, {हित की: बिल्लियाँ}}}"); सूची के & lt; स्ट्रिंग & gt; सूची = नया अर्रेलिस्ट & lt; स्ट्रिंग & gt; (); JSONArray सरणी = obj.getJSONArray ("रुचियां"); के लिए (int i = 0; i & lt; सरणी.लैम्बन (); i ++) {list.add (array.getJSONObject (i) .getString ("interestKey")); }

ruby - Better way of doing giant formatted data objects in Jekyll? -

I am converting my existing blog, currently it's a simple static site with JCEL, with some custom functions Flask + is supported by Frozen Flasked, and Jakele feels a good community around it, so I thought I could start using it instead of my existing semi-classical custom setup. Why does this make it interesting that blog content is nautilval and highly structured? There are three "conversations" in each post (codeinsider.us/i/5.html) and they have a name, description, IMG headshot, And includes the set of QAA. Here also the Metadata is in the encounter (name, intro, timestamp, etc.) Actually what I'm doing is sending a couple of questions and answers in a tuple, sliding into a list , The conversation specifies the word in the list, to throw each conversation in the list. The list of conversations, plus metadata, is the overallity of my blog's content. Converting it into jacail is a bit interesting. Jekeel does not perform mobility well in front or page

multithreading - C - Thread result in main -

I am studying C but my book actually provides some resources. I want to know whether it is possible and useful to some extent to use thread and then pass the main result. In case, I would like to know how to transmit the information from one thread to the main (something like returning method in Java) The only solution is to use a global variable? To tell what I would like to do, this is a little example, is it possible / useful? Main: int i = 1; pthread_create (tid, void, functionTH, zero); Int z = // getResultFromThread thread "function": zero * functionTH () {int z = 2; // Return the value 2 main and assign it to K in the main. } See the prototype . int pthread_create (pthread_t * restricted thread, const pthread_attr_t * restriction, zero * (* start_routine) (zero *), zero * restricted arg); Your thread ( start_routine ) is a function that returns zero * . Then your code is incorrect because your thread function does not return any returns. As

php - Simply posting variables through GET in cURL -

So I'm trying to create a small API here, I will only send some information through the header (get paramat) And I'm not using any POST parameters here's the code that I've written. function sendSMS ($ message, $ number) {/ *** connection is the ultimate ** / *** *** Generate request parameters *** / $ service = "sms_api_call_receiver.php"; $ Number = "1212"; $ Message = "asas"; $ Result = sendPost ("https://www.domain.com/smsapp/". $ Service. "? Message =". Urlencode ($ message). "And number =". $ Number); Return result; } // function function sendPost ($ Url) {// initialization $ ch = curl_init (); // Set the parameter curl_setopt ($ ch, CURLOPT_URL, $ Url); // Return a variable instead of posting curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, 1); // active post method // curl_setopt ($ CH, CURLOPT_POST, 1); // request // curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ strRequest); Curl_setopt ($ CH, CURLOPT_SSL_

SQL Server 2012 Basic way of removing doubles? -

Image
I am new to SQL Server and it is only related to school. I restrict myself SELECT , WHERE and ORDER BY I This code is Use Northwind Select Manufacturer, Unit Part, Discount from [Order Details] where UnitPrice & gt; 100 and discount! By using different , there should be no doubles, can I still manage it anyway? Edit: The assignment has to be unique product ID, so it basically ends with 29 and 38. Enter total 2 Lines: S This will allow you to only get productivity which is unique Select from the different productivity [Order details] where unitpris & gt; 100 exemptions! = 0

c++ - multiple pthreads are called multiple times; slower than serial code -

I resolve 4 econces on 2D discrete domain (Lx, LYA). These 4 eqns need to solve the steps of time of 1000. Each eqn will need parameters at the A, B and C (i, j) locations. I have dynamically created a_m, b_m, and c_m in main () and I will pass my address to each thread. I created 4 functions eq1, eq2, eq3, eq4. I am creating LX * LY numbers for each eqn. Each thread ID will be represnt in a unique (i, j) domain LX, LY. Therefore, each thread will only work in a specific data location (i, j) vectors a_m, b_m, c_m. Again, I'm mainly calling 4 units in sequential form (). In the sequence bcoz of 4 equations, the parameters A, B and C are updated on each (i, j) according to each equation. My program is running slower than serial computing. Can you suggest some optimization tips for speed up? I think creating 4 threads, solving each thread for each equation for Lx * LA time will not provide much movement. ex> # defined NLx * LY structure thread_data {int thread_id, t;

mysql - SQL loop with data aggregation -

इस सवाल का पहले से ही एक उत्तर है: < / p> 8 जवाब मैं MySQL 5.5 का उपयोग कर रहा हूँ .38 और निम्न तालिका मिली (यह सिर्फ एक स्निपेट है, वास्तविक में ~ 500 उत्पाद हैं): + ------ + ------- + - -------- + ------- + -------- + | आईडी | तिथि | उत्पाद | प्रकार | बिक्री | + ------ + ------- + ---------- + ------- + -------- + | 4513 | 14958 | XXXXXXX | 1 | 3 | | 4514 | 14958 | XXXXXXX | 2 | 5 | | 4519 | 14958 | YYYYYYY | 1 | 10 | | 4531 | 14958 | YYYYYYY | 3 | 150 | | 4534 | 14 9 559 | ZZZZZZZ | 1 | 5 | | 4536 | 14 9 559 | ZZZZZZZ | 2 | 5 | | + ------ + ------- + ---------- + ------- + -------- + < / प्री> जिससे मुझे उत्पाद द्वारा दैनिक बिक्री की मात्रा उत्पन्न करने की आवश्यकता है: + ------- + ---------- + - -------- + ---------- + | तिथि | XXXXXXX | YYYYYYY | ZZZZZZZ | + ------- + ---------- + ---------- + ---------- + | 14958 | 8 | 110 | 0 | + ------- + ---------- + ---------- + ---------- + | 14 9 559 | 0 | 0 | 10 | | + ------ + ---------- + ---------- + -----

java - What is localhost for Android? -

What is the 'localhost' address for Android devices? I am testing a program using the client server on the same app. Neither works for SERVER_IP = "http: // localhost" and "http://127.0.0.1" InetAddress serverAddr = InetAddress.getByName (SERVER_IP); Socket = new socket (serveradder, serverport); This returns: Unable to resolve the host "http: // localhost" : Hostname with Android No address is associated What is the best way to use a local host? UPDATE Thanks for all comments: "http: // localhost" / code> is indestructible right "localhost" or "127.0.0.1" or "127.0.0.2" , but I hope the best solution is to answer the answer. Communicate on TCP, which is a low level protocol compared to HTTP. When you have a socket communication If you are identifying, use the server's bare name (for example, "localhost") or a dotted quad (for example "192.168.0.1

java.io.StreamCorruptedException - Android -

I am developing an application in which the file has been downloaded from the server is encrypted in the application I decrypt it Trying to open an encrypted file stored in internal storage: ObjectInputStream ois = New ObjectInputStream (new cipherInputStream (context.openFileInput ("filename"), cipher)); String result = (string) ois.readObject (); but getting an exception: java.io.StreamCorruptedException This error means in this case Is, and how to fix it? Thank you. : Throwdown when the control information reads from the object stream It was violated, internal stability checks. Basically, what happens, somehow or the other, write and read "get out of the kilter" Here are some ways that can be Data that was forgotten to turn off the object overputstream (or the wrong stream was off) Forget to check return value of InputStream.read ().

if statement - How do you make an 'if' stament "do nothing" in C#? -

Here is an example of my code, I do not have to do the last if do anything, then Do something. if (daPilot.Gas> 0); Else daPilot.failMessage3 (); You have already done this. congratulation. Of course, very few confusing designs are not the only condition and after that there is no if is not with any else .

html - Cannot access non-static field "Repeater" in static context -

I have a web project project where I use a repeater; This is the code on the page: & lt; asp: repeater id = "repeater 1" runat = "server" & gt; & Lt; ItemTemplate & gt; & Lt; Div class = "events" & gt; & Lt; Div class = "" & gt; & Lt; H3 & gt; & Lt; A href = "& lt;% # DataBinder.Eval (container.detime," url ")%>" & Gt; & lt;% # DataBinder.Eval (container.datetime, "name")% & gt; & Lt; / A & gt; & Lt; / H3 & gt; & Lt; Span & gt; & lt;% # DataBinder.Eval (container.ditem, "location")%>. & Lt;% # DataBinder.Eval (container.detime, "datidysplay")% & gt; & Lt; / Span & gt; & Amp; Nbsp; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / ItemTemplate & gt; & Lt; / ASP: Repeater & gt; and here is codebehind: namespace testWebForms {public partial category

Microsoft Access Control Source help in Form -

I have a table, it is called "employee", it has a field called "month" This field There is a lookup, which is to refer to another table called "Journalist", the "monthly list" table looks like this: Monthly month 1 January 2 February 3 March. . . . "Month number" is there, so I can sort the list in sequential order (alphabetical order will not work for the month). I have a form where I am displaying the field "month" by using a text box (control source "month") I have set it so that users can choose or not change it ( I am using a text box so that there are no dropdown arrows). The issue is that it is displaying MonthNumber instead of the month name, I thought it would be a simple fix (and probably still), but I can not understand it. Any ideas on changing the display on the mahanama instead of MonthNumber? Changing the primary key to MonthName works in this position.

url - Why regex doesn't work? Swift -

I have this regex expression that works on iOS but not Does anyone know what is wrong? RegEx = Ansargyulr expression to (pattern: "v = (. +?) (? = \\ s | & amp;)", Options: Ansargyulrakspresokshnksnssnvednshil error: basic error: v = (. +?) (? = \ S | & amp;) Regex is applied to this test URL (separate): < code> Https://wwwkutubkcom/wac?w=sjifp5oi6dE Https://wwwkutubkcom/wac?w=gdigmngdam&mp; feature = Relmfu Https://wwwkutubkcom/wac?w= Gdigmngdam & amp; feature = Relmfu & amp; Asdsdsa Https://wwwkutubkcom/wac?w=gdigmngdam&mp;ficr=relmfu&mp;asdsdsa&mp;asdfksdsdsk%4&mp; Asdsdsd Https://wwwkutubkcom/wac?ficr=relmfu&mp; asdsadsa & asdfasdasdasQ% 4 & amp; asdsadsad & amp; v = gdigMMGadDM thanks The! Edit 1: Here is the code: // Get the Video ID var error: NSError? RegEx = Ansargyulr Akspsn (pattern: "v = (. +?) (? = \\ s | & amp;)", options: Ansargyulrakspresoptisessisinsensitiv, error

c# - Getting the placeholder values with Open XML SDK 2.0 -

I am trying to drill through a shape in a PowerPoint slide to get the placeholder values ​​of the shape . The shape on the shapes looks like this: & lt; P: sp & gt; & Lt; P: nvSpPr & gt; & Lt; P: cNvPr id = "10" name = "text placeholder 2" /> & Lt; P: cNvSpPr & gt; & Lt; A: spLocks noGrp = "1" /> & Lt; / P: cNvSpPr & gt; & Lt; p: nvPr & gt; & Lt; P: pH type = "body" sz = "quarter" idx = "13" is CustomPrompt = "1" /> & Lt; / P: nvPr & gt; & Lt; / P: nvSpPr & gt; & Lt; P: spPr & gt; & Lt; A: xfrm & gt; & Lt; A: off x = "457200" y = "3276601" /> & Lt; A: ext cx = "8229600" cy = "838199" /> & Lt; / A: xfrm & gt; & Lt; A: PriestGame Prix = "Rect" & gt; & Lt; a: avLst / & gt; & Lt; / A: prstGeom & gt; & Lt; / p: spPr & gt;

class - Parsing list of case classes -

I am quite new in Scala and I want to parse a list of case sections: D: Class Class D2 (C: String, D: IT) D Case Class D3 (E: IIT, F: String) enhances D Case Class D4E: String, F: String, G: IT) Expand D I want to parse an example of the listing [D]. A special order has been given in the list which can be explained by signaling like BNF: Representative (D0 -> D4 -> Representative (D2 - & gt; After OP (Representative (D3) D) 1-ND2 after D4, after each D2 1-ND3 and so on ... I want to type To create a list of: type T0 = (D0, D4, list [(D2, list [D3])]) All solutions I have found so far ugly and polite This is a ' = (D2, list [D3]) // Matching if in the list (D: D) :: (D4: D4) :: tail = & gt; ; Val (D2D3S, Tail 1) = Matchdie 2D3S (tail) (D, D4, D2D3S) :: Matchlist (Tail 1) Case Neal = & gt; Nil} DIF Match D2D3S (L: List [D]): (List [T1], List [D] = L Match {Case (D2: D2) :: Tail => Val (d3s, Tail1) = tail.span (_.InstanceOf [D3]) Val (Oth

In Ruby, what are the use cases for adding methods to an instance's singleton class? -

Thank you for some other posts and reading, I understand singleton / meta classes. And I think why we want to use them on the class. But I still can not understand why we want to use them at frequencies. And I still saw it in practice. I am referring to something like this: class vehicle DEF odometer _reading # some code end end my_car = vehicle new def my_car.open_door # some code end The first thought was that it seems like a bad idea because it has to face difficulties in understanding code and debugging. Why do we want to do this? When this is a good idea, what are some of its examples? An example is using it for testing purposes: Duplicate methods to create duplicate and double objects . Debugging is closer: redefining the logging method for a specific object that you suspect is wrong behavior, so that the log information is printed directly to the console (or more information printed) during the debug session. Another example is working with special cases - i

R match part of string against vector of strings -

मेरे पास अल्पविराम से अलग वर्ण वर्ग है ए = "123,456,789" और जब मैं चरित्र वर्ग में आइटमों में से एक को एक वर्ण सरणी में मौजूद होता है, तो मैं तार्किक वेक्टर प्राप्त करने का प्रयास कर रहा हूं। B & lt; - as.array (c ("456", "135", "78 9", "111")) मैं हूं आकार के तार्किक परिणाम की तलाश 4 (बी की लंबाई) [1] सही झूठ सही गलत आर के लिए काफी नया है इसलिए किसी भी मदद की सराहना की जाएगी । पहले से धन्यवाद। आप sapply और grepl के संयोजन का उपयोग कर सकते हैं, जो मेल खाते के साथ तार्किक लौटाता है < / P> sapply (B, grepl, x = A)

javascript - How to mute & un-mute a player button? -

I am trying to create a player who tries to mute my player without mute . For some reason I can only mute but can not mute the player. The same function works fine with play / pause button ... does anyone have any edged? & lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Input type = 'button' onclick = "mute_enumut ()" value = 'mute' class = "btn_rendem" id = "muteum" /> & Lt; Audio control = "control" preload autoplay = "autoplay" id = "audio 1" volume = "1.0" & gt; & Lt; / Audio & gt; & Lt; Script type = "text / javascript" & gt; Function MuteUnmut () {var MuteSound = document.getElementById ("audio1"); x = new boolean (mutusound.moot = false); If (x) {document.getElementById ('audio1'). Mute = true; . Document.getElementById ("muteunmute") value = "United Nations

javascript - Event handling for geometries in Three.js? -

Image
I have some types of event handling for geometries / cameras / lights (things that we add to the scene) in three.js I am looking for I can googled but can not find anything relevant, I rendered a simple field and tried to see the DIV content in firebug, but there is only one canvas, and adding any "onclic" to the canvas From the event for all canvas, it is not just for the hemisphere or light. Any suggestions? You need some o things to achieve interactivity Mouse Get a vector for the position Unexpected the mouse vector on the camera basis A ray shot from the camera's position, It may be complicated, but the code already exists: p> function on documentmousedown (event) {event.preventDefault ( ); Var vector = new three. Vector 3 ((event.clientX / window.innerWidth) * 2 - 1, - (event.clientY / window.innerHeight) * 2 + 1, 0.5); Projector. Inject vector (vector, camera); Var ray = new three Ray (camera.Search, vector.sib (camera.Search). Genera

c# - Website doesn't see newest session values until I refresh page, but refreshing resets values of controls -

My asp.net website does not see the latest session value when clicking on the server If my form is being sent, then the browser sent back to the result is based on the session values. I'll process them in the Page_load method. This last change od Session does not see value, but before the last one. It seems that the event handlers of the buttons are executed before the event on the page, but I'm not sure it is the same. I tried to code my code in other ways like Page_ PreInit, but it is still similar. The only thing that works for me is that the page refreshes: feedback. Redirect (request. URLSOLUTURI); After any change of any session value, but it resets the values ​​all the controls, which I want to be as before. Is there a better solution? Example: When it first runs, the text of the label is "click on the button", but when I click on a single button, nothing happens go. When I click any button for the second time, the text of the label is the va

php - SQL Syntax Error when executing mysqli_query -

I have a PHP registration script with MySQLi and OOP. But when executing a query I get a mysql syntax error . There is an error in your SQL syntax; Manual 'related to MySQL server version', which is related to using 'pass' -mail, ip_register, ip_lastlogin, lastlogin for correct syntax value) (' ',' RAVX, ******, *** * 'Line 1 on PHP Code: $ register_sql = "User (id, username, password, PIN, e-mail, IP_ registration, ('', $ Username, $ password, $ pin, $ email, $ IP, IP, $ live tag) "; Does the problem solve? > mail sql is telling you where the error starts from * delinquent character You need to wrap / incubate the e-mail column in backtacks because there is a hyphen in it. The SQL stats that you want to math which translate From: e zero mail plus, quotation marks in your values ​​ $ Register_sql = "Include in user (id, username, password, pin,` e-mail`, ip_registry, ip_listin, l ($ "&qu

swift - how would i skip displaying certain entries when populating cell rows from core data in a tableviewcontroller? -

For an app I'm working, I have saved many items in my coredata model My intention is to print selectively for those people who are based on the fact that some characteristics are true. The items given in the CoreData example: ///////////////////// 1 - name, which displays: true 2 - name: Sally, display: false 3 - name: Bob, display: false 4 - Name: Jess, Display: True ///////////////////// I want only my table scenes To demonstrate where the demonstration is true, only 4 and 4 of the entries will be listed in my table view So far, I only know that every A item how to print with the table view data source protocol Thanks for a noob to help! I will do something like this: // unit here "user " var myUsers = [user] () var fetchRequest = NSFetchRequest (called EntityName:" user ") Prvinit to = NSPredicate (format:" display =% @ ", true) FetchRequest.predicate = Probably / sort sort? On sortDescriptor = NSSortDescriptor (k

c# - Update Entity property in EF where property is another entity -

I am using unit framework 6 and I need to update the properties of an entity. I have the following entities: Public class file {public Int32 ID {get; Set; } Receive public byte data; Set; } Public Date Time Update {get; Set; } Public virtual mm wax {get; Set; }} Public Class Mime {Public Int32 ID {get; Set; } The name of the public string {get; Set; } Public Virtual Icons & lt; File & gt; Files {get; Set; }} Then I used the following: _repository.update & lt; File & gt; (File, x => x.Data, x => X.Mime, x => x.Updated); The repository method is: Public Zero Update & lt; T & gt; (T unit, parameter expression & lt; funk & lt; t, object & gt; & gt; [] attribute) where t: class {_context.Set> & amp; T & gt; (). Attached (unit); Foreach (property in properties) (Member expression expression = property member member expression? (Member Experience) Property: Body: (Member Impact) ((Property of Property).) Operand;

rest - How to Update a resource with a large attachment with PUT request in JAX-RS? -

I have a large byte file (log file) that I PUT code is that I select PUT because I can use it to create a new resource or update existing resource. My problem is that when there is a server or network disruption, during PUT request it says that I have a large file, during which the transfer occurs, there is a network failure. When the network starts again, I do not want to start the whole upload. How do I handle it? I am using the RESTeasy implementation with the JAX-RS API. Some people use the content-range header to obtain this code. , But many people (like Mark Nottingham) say that it is not legal for requests. Please read this comment. Apart from this there is no support from JX-RS for this scenario. If you actually broke the PUT request that I just want to trim the files to the client: PUT / log / {id} / 1 PUT / log / {id} / 2 PUT / log / {id} / 3 received / log / {id} then all The aggregation of successful slices will be returned back.

python - Django ManyToMany Relation "Contains" Statement -

I am creating a small task manager, all the labels of the job are that I must select all the tasks in which some labels At the moment, I am: task = tasks.obages.Al (). Filter (label_in = label_list) .distink () Returns all the tasks, where at least one label is also in the label_list, but I only need those labels whose labels All label labels are in the list More precise examples: If I pass [['1', '2'] in the form of a label 'list', then I not all the tasks Label 1 or label 2 returned (now it is happening), but label 1 and are labeled as 2 All work should be returned. I want to work with label in label list The relation task label is many: class Work (models.Model): .... label = Models.ManyToManyField (label, empty = true, empty = true) .... This is reaching the limits of the OSM of the DNS, but you can try: labels = [ '1', '2'] qs = Task.objects.all (): qs = qs.filter (label = label). Distinct () Obviously,

Change value in one row after comparison with the next row in R -

मेरे पास डेटाफ्रेम है जैसा स्थिति क्रो स्कोर 10101 chr1 0 450 9 chr1 3.58051 10745 Chr1 0 2344 chr1 0 7165 chr1 -2.59335 6752 chr1 -2.655688 7441 chr1 0 7588 chr1 -4.022041 10671 chr1 0 यदि z स्कोर का एक शून्य शून्य मान है मैं इसे परिवर्तित करना चाहूंगा शून्य के लिए केवल अगर पिछला मूल्य शून्य या गैर-शून्य से भिन्न दिशा में (यानी सकारात्मक या नकारात्मक)। ऊपर के लिए मैं डेटासेट को निम्नानुसार दिखना चाहूंगा: स्थिति Chr स्कोर 10101 chr1 0 450 9 chr1 0 10745 chr1 0 2344 chr1 0 7165 chr1 -2.59335 6752 chr1 -2.655688 7441 chr1 0 7588 chr1 0 10671 chr1 0 मुझे लगता है कि मुझे फ़ंक्शन लागू करने की आवश्यकता है, लेकिन मैं इसका उपयोग कैसे करना नहीं जानता। कोई भी मदद कर सकता है? इसलिए मुझे पता है कि यह थोड़ा चपटा दिख रहा है, लेकिन यह एक सदिश है (प्रकार की) समाधान तो ऐसा है आप तकनीकी रूप से यह एक पंक्ति में भी कर सकते हैं, लेकिन यह एक पंक्ति के एक छल्ले होगा! पहले आप तुलना करेंगे विभिन्न वैक्टर सेट करेंगे, "परीक्षण" मेरे स्कोर कॉलम की प्रतिकृति होगी परीक्षण & lt

How to define encounter periods by using first and last timestamps within a time series in R -

I work with electronic tagged fish. One snippet of my telemetry data (dataframe "D") is below each timestamp represents an identity for a unique fish. Tag ID Place of inquiry RiverKm 163 02/23/2012 03:17:44 Alcatraz_E 4.414 163 02/23/2012 03:56:25 Alcatraz_E 4.414 163 04/14/2012 15:10 : 20 Alcatraz_E 4.414 163 04/14/2012 15:12:11 Alcatraz_N 4.414 163 03/11/2012 08:59:48 Alcatraz_N 4.414 163 03/11/2012 09:02:15 Alcatraz_N 4.414 163 03/11/2012 09 : 04:05 Alcatraz_N 4.414 163 03/11/2012 09:04:06 Alcatraz_N 4.414 163 03/11/2012 09:06:09 Alcatraz_N 4.414 163 03/11/2012 9:06:11 Alcatraz_A 4.414 < / Pre> There are several different tags (personal fish). I want to classify detections for every fish during the encounter period by identifying a start time ("arrival") and an expiry time ("departure"), with an important value of 1 hour. For example, for the above fish (Tag ID 163), the output will be: Tagged Arrival Departure Location RiverKm 163 02/

java - HashMap string key -

I have a bug in my Android app and what I can not find is wrong, something that I think is problematic And I need your help I have low embarrassment hashmap & lt; String, string & gt; Numbers = New Hashmap & lt; String, string & gt; (); And I am including data like this, numbers.put ("1", "one"); Numbers ("2", "two"); Then I search for it like this, numbers.get ("1"); Is that correct? Please note that the above is working well, sometimes I see weird behavior as I mentioned earlier update, I forgot "put in" No, this will not work. You must put the same type of keys. Maybe you mean numbers ("1 one");

java - Alphabetical value -

The string "code" appears anywhere in the string, return the number of times, for 'D' Any letter will accept, therefore "counting" and "ku" count Use a regex: string.matches ("Co [az] e") To calculate the number of matches: int count = 0; Matcher m = Pattern.compile ("with [a-z] e"). Mattress (string); While (m.find ()) {count ++; }

stdout - Using tee to get realtime print statements from python -

इस सवाल का पहले से ही एक उत्तर है: < / P> 15 उत्तर मेरे पास एक अजगर स्क्रिप्ट है ऐसा कुछ दिखता है: संग्रह में आइटम के लिए प्रिंट करें "प्रिंट करें" क्या करें "#" जटिल सामान जो एक लंबा समय लेता है। बैश में, मैं निम्नलिखित से यह स्क्रिप्ट चलाता हूं: $ python my.py | Tee my_file.txt हालांकि, प्रोग्राम को खत्म होने तक मैं बैश में देखता हूं एक रिक्त रेखा है। फिर, सभी प्रिंट स्टेटमेंट एक बार आते हैं। क्या यह टी की अपेक्षित संचालन है? क्या मैं री-टाइम में आउटपुट देखने के लिए टी का उपयोग कर सकता हूं? पायथन, कई कार्यक्रमों की तरह, जितनी बार इसे लिखते हैं सिस्टम कॉल कॉल की संख्या को कम से कम करें यह कई प्रिंट बयान के उत्पादन को इकट्ठा करने से पहले करता है इससे पहले कि वे वास्तव में अपने मानक आउटपुट फाइल में लिखते हैं इस प्रक्रिया को आउटपुट बफ़रिंग कहा जाता है जब पायथन टर्मिनल से जुड़ा होता है, तो इसकी आउटपुट को बफर नहीं करता है। यह समझ में आता है, क्योंकि टर्मिनल में इंसान आउटपुट को तुरंत देखना चाहता है। जब पायथन एक फाइल (या एक पा

c# - How to get returned value of async Task methdoName()? -

I am trying to get the return string of my method but the problem is that I do not know how I get it I can public async Tasks & lt; String & gt; Log In (String Username, String Password, String Site) . This is my code from Program.cs Fixed zero main (string [] args) {Var username = "Leonel.Sarmiento"; Var Password = "Welcome"; Var site = "QADBSite"; Var url = "na1.sabacloud.com"; Console Customizer.Spinner Spinner = new ConsoleCustomizer.Spinner ("+", "x", "+", "x"); Console Customizer.TypeWriter TypeWriter = New Console Customizer.TypeWriter (15, 150); Console Customizer.Alerts Alert = New Console Customizer.Alerts (); Alert. Type ("notification", "HOST URL:", blank); TypeWriter.WriteLine (@ "http: \\" + URL); Alert. Type ("notification", "USERNAME:", tap); TypeWriter.WriteLine (username); Alert. Type ("notification", "passw

Changing Variables in Class from Other Classes (Python) -

मेरे पास यह कोड है: class hello_world (): def define_hello (self) : self.hello = "हैलो" डीईएफ़ say_hello (स्वयं): प्रिंट self.hello वर्ग change_to_goodbye (): def __init __ (स्वयं): self.helloWorld = hello_world () डीईएफ़ hello_to_goodbye (स्वयं): self.helloWorld.hello = "अलविदा "वर्ग अन्य_ वर्ग (): def __init __ (स्वयं): स्वयं। हिलेलो वर्ल्ड = हेलो_वार्ल्ड () स्वयं। बदलाव करेंगूडबाई = परिवर्तन_टो_गुडबाइ () स्वयं। हिल्लोवॉल्ड। डेफिन_हेल्लो () स्वयं। बदलाव। गोवा। द्वारा। () कक्षा हैलो_वर्ल्ड के दो तरीके हैं, जो कि वेरिएबल हैलो को परिभाषित करता है और जो इसे प्रिंट करता है दूसरी ओर, वर्ग change_to_goodbye को वेरिएबल हैलो वर्ग hello_world में प्रवेश करने की कोशिश करता है और इसे अलविदा में बदल देता है। क्लास other_class को वेरिएबल हैलो को "हैलो" पर सेट कर दें, इसे "अलविदा" में बदलकर स्क्रीन पर प्रिंट करें। मुझे उम्मीद थी आउटपुट "अलविदा" होने पर मुझे "हैलो" मिला change_to_goodbye hello_world के इ