Posts

While Loop in Azure SQL -

in azure stream analytics query want write while loop using declare/set counting. declare @x int set @x = 0 while @x < 90 begin set @x = @x + 1 *my code '@x' counter* end the error message claims: declare @x int unsupported statement. is there basic overlooked? if comment out declare command, asa sql doesn't set command. if leave out while loop , replace @x number in code, works fine.

ios - Is there any way to access an SFSafariViewController's contentOffset? -

i want have access contentoffset values of sfsafariviewcontroller. i tried subclassing sfsafariviewcontroller in order set scrollview's delegate, looks sfsafariviewcontroller doesn't expose it's scrollview. is there way set scrollview's delegate or access contentoffset values ?

python - Get intersection range of two non-discrete intervals -

given interval defined start , end point (both floats), determine intersection range second interval. example: int1 = [2. , 5.] int2 = [2.2, 7.] >>> desired_function(int1, int2) 2.8 it should handle intersection possibilities (no intersection, partial intersection, complete intersection, negative ranges etc.). attempt looks this: def intersection(int1, int2): #case 1: partial intersection on left or right border if (int2[0]<=int1[0] , int2[1]<=int1[1]) or (int2[0]>=int1[0] , int2[1]>=int1[1]): return min(int1[1],int2[1]) - max(int1[0],int2[0]) #case 2: complete overlap of 1 interval other elif (int2[0]>=int1[0] , int2[1]<=int1[1]) or (int2[0]<=int1[0] , int2[1]>=int1[1]): return min (int2[1]-int2[0] , int1[1]-int1[0]) #case 3: no overlap @ else: return 0 question: have missed , there build-in solution or package similar since want keep code simple , fast possible? you making thing...

java - Cannot parse data from the phpmyadmin -

Image
i'm trying retrieve data phpmyadmin on android app ,but first want test through logcat see if works .when test ,i don't names of users in database sadly . this showusers class : package ie.example.artur.adminapp; import android.content.intent; import android.os.bundle; import android.os.strictmode; import android.view.menu; import android.view.menuitem; import android.widget.arrayadapter; import android.widget.listview; import android.widget.toolbar; import android.os.asynctask; import android.os.bundle; import android.support.design.widget.floatingactionbutton; import android.support.design.widget.snackbar; import android.support.v7.app.appcompatactivity; import android.view.view; import org.apache.http.httpentity; import org.apache.http.httpresponse; import org.apache.http.client.httpclient; import org.apache.http.client.methods.httppost; import org.apache.http.impl.client.defaulthttpclient; import java.io.bufferedreader; import java.io.inputstream; import java.io...

c# - Using constructor injection when caller expects a specific constructor signature -

i'm new di in .net c# & autofac , having problems understand how use di when can't control caller side. there 2 scenarios have problems understand. scenario 1: caller expects default constructor (without parameters) how handle scenario when still want inject service interfaces when class constructed? thinking of constructor chaining, mean have know concrete type , works around idea of di. (at least think). public class serviceworker { iservice _service; public serviceworker(iservice service) { _service = service } } public class caller { // no way change this. var serviceworker = new serviceworker(); } scneario 2: caller expects specific constructor signature (e.g. same question here. how can inject additional dependencies when caller expects exact match constructor signature? i think main issue in understanding concept is, don't see how di partially when not constructed di (caller) public class serviceworker { ...

java - How to solve Class not found in gnu.gcj.runtime.SystemClassLoader in Unix -

i trying run java class .jar file in unix environment, getting following error, exception in thread "main" java.lang.noclassdeffounderror: systembootstrap @ gnu.java.lang.mainthread.run(libgcj.so.7rh) caused by: java.lang.classnotfoundexception: systembootstrap not found in gnu.gcj.runtime.systemclassloader{urls=[], parent=gnu.gcj.runtime.extensionclassloader{urls=[], parent=null}} @ java.net.urlclassloader.findclass(libgcj.so.7rh) @ java.lang.classloader.loadclass(libgcj.so.7rh) @ java.lang.classloader.loadclass(libgcj.so.7rh) @ gnu.java.lang.mainthread.run(libgcj.so.7rh) the command using run class java -cp batchframework.jar systembootstrap dnqltrbatch dev1 systembootstrap class called , not able solve this.and new unix.

Connec to Hive from Apache Spark -

i have simple program i'm running on standalone cloudera vm. have created managed table in hive , want read in apache spark, initial connection hive not being established. please advise. i'm running program in intellij, have copied hive-site.xml /etc/hive/conf /etc/spark/conf, spark-job not connecting hive metastore public static void main(string[] args) throws analysisexception { string master = "local[*]"; sparksession sparksession = sparksession .builder().appname(connecttohive.class.getname()) .config("spark.sql.warehouse.dir", "hdfs://quickstart.cloudera:8020/user/hive/warehouse") .enablehivesupport() .master(master).getorcreate(); sparkcontext context = sparksession.sparkcontext(); context.setloglevel("error"); sqlcontext sqlctx = sparksession.sqlcontext(); hivecontext hivecontext = new hivecontext(s...