Vote count: 0 I need to authenticate the user using asp.net identity then need to use the social login to get there profile detail. Owin does't allow two login at the same time. please help me out of this. thanks in advance. asked 1 min agoNitin Singh Let's block ads! بخوانید...
ادامه مطلبVote count: 0 is it possible to do this , im trying to validate a form then, it will redirect using header() if TRUE.. but it seems not to be working? or my method is completely wrong ? if ($_SERVER["REQUEST_METHOD"] == "POST") { $email = $_POST["clientEmail"]; if ($email != $sentEmailClients) { echo 'Please enter a valid email'; } else{ $newURL = "http://www.myurl.com"; header('Location: '.$newURL); } } asked 40 secs agojmv Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I receive and error while calling udf from within withColumn in Spark using Scala. This error happens while building with SBT. val hiveRDD = sqlContext.sql("select * from iac_trinity.ctg_us_clickstream") hiveRDD.persist() val tEventDf = hiveRDD .withColumn("system_generated_id", getAuthId(hiveRDD("session_user_id"))) .withColumn("application_assigned_event_id", hiveRDD("event_event_id")) val getAuthId = udf((session_user_id:String) => { if (session_user_id != None){ if (session_user_id != "NULL"){ if (session_user_id != "null"){ session_user_id }else "-1" }else "-1" }else "-1" } ) I receive the error which is - scala:58: No TypeTag available for String val getAuthId = udf((sess...
ادامه مطلبVote count: 0 This is an extended question from Assigning column names in a txt file in python I have the following code. I extracted data from a xml file and saved it into a txt file. Then I imported it in sqlite3. Here, I can see the whole database. However, while I query, I can only use programID. For the rest, I all failed. I am not sure where I did wrong. I appreciate any assistance. Thank you. try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET import sys reload(sys) sys.setdefaultencoding('utf-8') root = ET.parse("complete.xml") f = open("conductor.txt", "w") # Open the file in (w)rite mode f.write("programID, season, workID, composerLastNam...
ادامه مطلبVote count: 0 Why this code is not working: $bdd->prepare("UPDATE `articulos` SET `telVisto` = `telVisto` + 1 WHERE `ID` ='".$_GET['id']."' "); I'm using a PDO conection that works good because it works good with other queries. Here is my data base conection: $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION; $bdd = new PDO('mysql:host=localhost;dbname=lacajota', 'root', '', $pdo_options); And yes I want to update telVisto incrementing 1 for each time the code is run. Thank you asked 25 secs agoBoris Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am struggling to make animated circular gauge using wxWidgets. I've tried using wxSVG with SVG image so it would scale with window, it worked on Linux but compilation of that library under Windows was such a problem I quit that approach. I've also tried using wxArt2D but it didn't compile even under Linux. Now I'm using wxDC and wxImage but it doesn't refresh on rescale and it has large CPU overhead (laptop i7 is used by about 30%). Here is my code: void MyFrame::OnPanel2EraseBackground(wxEraseEvent& event) { } void MyFrame::OnPanel2Resize(wxSizeEvent& event) { wxSize panelSize = event.GetSize(); gaugeBuffer = gaugeImg.Scale(panelSize.GetX(), panelSize.GetY(), wxIMAGE_QUALITY...
ادامه مطلبVote count: 0 Elasticsaerch's documentation only covers loading a complete index to Spark. from pyspark.sql import SQLContext sqlContext = SQLContext(sc) df = sqlContext.read.format("org.elasticsearch.spark.sql").load("index/type") df.printSchema() How can you perform a query to retu data from an Elasticsearch index and load them to Spark as a DataFrame using pyspark? asked 1 min agoGeorge Lydakis Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I'm creating a select including several sub-queries but I didn't find a way to use the sub queries values to create the where statement seems to be ignored. I had 1 content Table, 2 join tables with 2 other tables in join and another table in join wjth the first directly. I tried several solution, this is latest one select * from (SELECT a.idcontents, a.title, concat(a.filepath, '/', a.filename) as file, a.captured_on, a.starred, a.file_type, @PL:=(select GROUP_CONCAT(CONCAT(p.idplaces, '-', p.place) SEPARATOR ', ') from places p where a.idplaces=p.idplaces) as places, @AL:=(select GROUP_CONCAT(CONCAT(al.idalbum, '-', al.album) SEPARATOR ', ') from album al, join_album_contents...
ادامه مطلبVote count: 0 I'm trying to store full value of current day's datetimeticks to a bigint SQL Datatype as Session ID. But couldn't possibly convert datatype(s) successfully. My objective is to get current Datetime.Ticks in C# and store it as SessionId in SQL Server.(version 2008 R2) In SQL Server, I declared SessionId as bigint as follows: [Session_Id] [bigint] NOT NULL In C# (Winform), I currently use this(working fine): long sessionId; sessionId = Convert.ToInt64((long)BigInteger.Divide(DateTime.Now.Ticks,(BigInteger)5445654850112.1245)); I tried to use without truncating values from BigInteger as below but it throws error. BigInteger sessionId = DateTime.Now.Ticks; The error of snapshot I g...
ادامه مطلبVote count: 0 I am sorting an array filled with hashes using the below: array.sort_by {|hash| hash[:key_name]} When I sort by array[:damagemin] all the numbers sort except the lone 4-digit number which is being sorted as if it is a "1": bydamagemin => [{:heroname=>"Bastion", :winrate=>"53.6%", :damagemin=>"1079", :herokd=>"2.23:1"}, {:heroname=>"Lúcio", :winrate=>"57.6%", :damagemin=>"328", :herokd=>"1.51:1"}, {:heroname=>"Mei", :winrate=>"51%", :damagemin=>"451", :herokd=>"1.95:1"}, {:heroname=>"Reinhardt", :winrate=>"51.3%", :damagemin=>"463", :herokd=>"1.28:1"}] How can I resolve this issue and sort the numbers from highest to lowest regardless of their length? asked 15 secs agoJoel B Let...
ادامه مطلبVote count: 0 I want to scroll listview horizontally in my android application. I found many solutions on inteet but that doesn't work for me. Anywhere i found a solution to use gallery instead of listview. But now problem is that, the distance between two consecutive textviews is very much, as shown in image. So i want to reduce it. So that i can scroll and view text effectively. Screen shot of current view MainActivity import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.Menu; ...
ادامه مطلبVote count: 0 Controller: $scope.init = function(team){ $http.get("/getLeaderByTeamID/"+team.id) .success(function (data, status, headers, config) { // this is the object that I need to list in the table $scope.leader = data; }) .error(function (data, status, header, config) { $log.error("Error!"); }); } The data-ng-repeat directives in the table: Team Leader {{team.name}} {{l.name}} The logic is as follow: When every team is listed the init() function will send the object to the controller. In the other side the init() function will make a query with the ID team in order to get its respective leader. The function will retu one object and the second ng-repeat directive will list this into it...
ادامه مطلبVote count: 0 I have the message type nav_msgs/Odometry constantly publishing linear and angular velocity. I am calculating linear distance by taking Velocity at X and Y, multiply them by 1/rate(Hz) and summing them together. Is this calculation right? Also, I am a bit skeptical about calculating the tu using angular velocity. Any guidance here is appreciated. I am visualizing the path in RViz. It would be great if you could point me to relevant source code that I could look into. asked 29 secs agouser3792934 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 In terms of performance and good practice, is it better to create a new row for every new json object or just append objects to an json object array all within one row? I'm building a NodeJS application that will let the user create, read, update and delete data from the json objects. Also, how would you go about appending a new object to a specific json object array in NodeJS and PostgresQL? I couldn't find any examples online. What is the insert command to do it for this example where the table name is "myData", "data" is the column name and I want to insert 5 into "b": data {"a": 1, "b": [1, 2, 3]} asked 1 min agouser3226932 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have built a Wikipedia dictionary using the following code: from gensim.corpora import WikiCorpus, wikicorpus articles = "enwiki-latest-pages-articles.xml.bz2" wiki_corpus = WikiCorpus(articles) wiki_corpus.dictionary.save("wiki_dict.dict") Now I have a set of text sentences. I want to run a query of these texts against certain words (set of affinity categories), where the definition of these words can be taken out from the wiki corpus. So for example: This is the set of text: ["make a lot of money through magic millions website" , "travel through virgin mobile", ...] This is the set of affinity categories: ["Foodie", "Cooking", ...] So affinity categories are the words that ...
ادامه مطلبVote count: 0 I am using xhr to make a call to server and it retus a blob. have set the respnoseType='blob' and it all works fine in chrome and firefox even in ie10+ but doesn't work in safari. if (navigator.appVersion.toString().indexOf('.NET') > 0) { window.navigator.msSaveBlob(blob, fileName); } else { var downloadUrl = URL.createObjectURL(blob); var a = document.createElement("a"); a.href = downloadUrl; a.download = fileName; document.body.appendChild(a); a.click();} what is the right way to do this, as this looks like a hack!. asked 33 secs agouser1861140 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I've been using Renci.SshNet in C# to check some info about a server using an SSH coection. I am trying to use the command: sshClient.RunCommand("show ports").Result; to generate a string and check if all the ports on a server are enabled. The RunCommand().Result method has worked perfectly with every other command but for some reason refuses to print anything when I try to run "show ports." Does anyone know why this could be the case? asked 32 secs agoJpskida Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have a gridview and i add a search textbox in every coloumn using jquery. I try to search in the textbox it works nice. But here i have two problem: When i search to the gridline and select the row, it retu me the row before the row i selected. if i change the CssClass to form-control both in aspx.cs and in the javascript, the search action can not work, it retu nothing. ` ASPX.CS protected void OnDataBound(object sender, EventArgs e) { GridViewRow row = new GridViewRow(0, 0, DataControlRowType.Footer, DataControlRowState.Normal); for (int i = 0; i < gv_dalamkota.Columns.Count; i++) { TableHeaderCell cell = new TableHeaderCell(); TextBox txtSearch = new TextBox(); txtSearch.A...
ادامه مطلبVote count: 0 I have 2 Apps which have the same package name but different package IDs(set in gradle config). An activity is started by setting an intent's action string in both the apps which are same in both Apps. This means that if I have both the Apps installed on the same device then starting an Activity shows me a Complete action using.. dialog which asks the user to choose an activity to complete the action with. My question is as to how I can separate them without going through changing the string itself in the manifest files (a lot of them due to multiple modules) and the setting of action string before using startActivity() itself in the codebase so that the actions are limited to ...
ادامه مطلبVote count: 0 I have created a C++ program and class, and plan to compile it to a library. I have found several websites explaining how to create and use wrappers to access the C++ class methods. My environment is IAR EWARM which in my case I need to use standard C. To create class instantiated objects, I am using (or will need to use) operator "new", i.e., for class "scDev": bLink1 = new( scDev ); I have been searching for information on how to instantiate objects using the "new" operator from a C program, but unable to find how this can be accomplished. Can someone provide some insight on how to go about this, perhaps an example or website link? Thanks....Gary asked 1 min agouser10326 1 An...
ادامه مطلب