jeudi 5 novembre 2015

SSRS Expression in field using IN

Vote count: 0

I am trying to filter the data returned in a field using multi-value parameters. I need to filter based on 3 conditions:

--Before a Warranty End Date

--AND Service Type on the record must match one of the MULTI-VALUE parameters selected by the user

--AND Order Type on the record must match one of the MULTI-VALUE parameters selected by the user

Currently, this works for the first selection I described above (to sum only those records with a service date <= warranty end date , however, I cannot get the syntax to also check the 2 other fields based on the parameters selected...

Sum(iif(Fields!FirstServiceDate.Value <= Fields!WarrantyEndDate.Value, CDbl(Fields!ExtendedCost.Value), CDbl(0)))

asked 1 min ago
Liz
1

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



SSRS Expression in field using IN

Oracle setup with OWNER and USER fails to use one SCHEMA_VERSION table

Vote count: 0

We are evaluating flyway to setup an Oracle database that has an OWNER schema where all tables live, and an USER, who gets granted access to OWNER tables in the form of synonyms. Sometimes the USER needs to write their own tables, too. We'd also like to keep the upgrade sql scripts in one subdirectory, rather than having a separate directory for OWNER and USER each.

So, OWNER has the following config:

flyway.url=jdbc:oracle:thin:@localhost:1521
flyway.user=OWNER
flyway.schemas=OWNER
flyway.password=OWNER

and USER, correspondingly

flyway.url=jdbc:oracle:thin:@localhost:1521
flyway.user=USER
flyway.schemas=OWNER, USER
flyway.password=USER

where i would expect that flyway will access the SCHEMA_VERSION table in the OWNER schema, as it is the first one in the list of schemas.

The whole thing runs in vagrant, and when i say vagrant up i get an error message. The relevant snippet is:

==> vagrantbox: Successfully applied 1 migration to schema "OWNER" (execution time 00:00.388s).
==> vagrantbox: flyway -configFile=config/USER.conf -target=1.99999 migrate
==> vagrantbox: Flyway 3.2.1 by Boxfuse
==> vagrantbox: Database: jdbc:oracle:thin:@localhost:1521 (Oracle 11.2)
==> vagrantbox: Validated 4 migrations (execution time 00:00.119s)
==> vagrantbox: Creating Metadata table: "OWNER"."schema_version"
==> vagrantbox: ERROR:
==> vagrantbox: Script failed
==> vagrantbox: -------------
==> vagrantbox: SQL State  : 42000
==> vagrantbox: Error Code : 1031
==> vagrantbox: Message    : ORA-01031: insufficient privileges
==> vagrantbox: Line       : 17
==> vagrantbox: Statement  : CREATE TABLE "OWNER"."schema_version" (

which looks like flyway is able to determine that the schema_version table for USER is supposed to be in the OWNER schema, but fails to see that it's already there.

In the flyway sources i see that this check is done in MetadataTableImpl like this:

private void createIfNotExists() {
    if (table.exists()) {
        return;
    }

which in turn for Oracle results in a call to the connection's metadata:

        resultSet = jdbcTemplate.getMetaData().getTables(
                catalog == null ? null : catalog.getName(),
                schema == null ? null : schema.getName(),
                table,
                types);
        found = resultSet.next();

Does this work with a stock Oracle XE version 11.2.0 JDBC driver? After adding xdb6.jar and xmlparserv2.jar from SQL Developer to the classpath the following groovy snippet

def results = conn.getMetaData().getTables(null, "OWNER", "schema_version")
println results.next() as boolean

claims otherwise:

$ groovy TestMetaData.groovy
false

That would explain that flyway seems to think the table is not there, but now i am completely stumped. What is going on here? Surely the call to getMetaData().getTables() must work in general? Or is this something the thin driver can't do?

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Oracle setup with OWNER and USER fails to use one SCHEMA_VERSION table

Dividing Layout vertically in two equal parts

Vote count: 0

I am trying to create a layout file where i have to divide the screen into 2 equal parts. I have spent lot of time to do this.But i am not able to achieve it.

I checked this post also

How to split the screen with two equal LinearLayouts?

How to divide screen into three parts vertically?

Still I was not able to achieve it.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout  xmlns:android="http://ift.tt/nIICcg"
 xmlns:app="http://ift.tt/GEGVYd"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:background="@color/profileImBg"
        android:orientation="horizontal"
        >


        <ImageView
            android:id="@+id/profileIm"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:src="@drawable/profileImage" />


    </LinearLayout>

    <android.support.v7.widget.CardView
        android:id="@+id/card_view"
        style="@style/cardStyle"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <android.support.v7.widget.GridLayout
            android:id="@+id/buttonGrid"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="16dp"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            android:layout_marginTop="16dp"

            app:columnCount="2"
            app:rowCount="2">

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_marginBottom="8dp"
                android:layout_marginRight="8dp"
                android:text="Name"
                android:textColor="#757575"
                android:textSize="16sp"
                app:layout_column="0"
                app:layout_columnWeight="1"
                app:layout_row="0"

                />


            <TextView
                android:id="@+id/name"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_marginBottom="8dp"
                android:layout_marginLeft="8dp"
                android:textColor="#757575"
                android:textSize="20sp"
                app:layout_column="1"
                app:layout_columnWeight="1"
                app:layout_row="0" />

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_marginBottom="8dp"
                android:layout_marginRight="8dp"
                android:text="Contact Number"
                android:textColor="#757575"
                android:textSize="16sp"
                app:layout_column="0"
                app:layout_columnWeight="1"
                app:layout_row="1"

                />


            <TextView
                android:id="@+id/contactNumber"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_marginBottom="8dp"
                android:layout_marginLeft="8dp"
                android:textColor="#757575"
                android:textSize="20sp"
                app:layout_column="1"
                app:layout_columnWeight="2"
                app:layout_row="1" />






        </android.support.v7.widget.GridLayout>

    </android.support.v7.widget.CardView>

</LinearLayout>

asked 2 mins ago
Zero
101

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Dividing Layout vertically in two equal parts

Draw a circle's sector using its borders

Vote count: 0

I want to draw a sector of a circle using borders only in order to make something like a chart, but if it's possible I don't want to use any plugins.

.circle {

    background-color: transparent;
    border: 4px solid #0c8a98;
    border-radius: 100%;
    height: 50px;
    width: 50px;
}

asked 2 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Draw a circle's sector using its borders

What's the most reliable way to detect if the user is logging in from a different device than usual?

Vote count: 0

I suspect we're all familiar with how facebook and google and the like detect if you're using a different device than usual, I was wondering what the most reliable way to do this is?

I'm talking about the old 'It looks like you're signing in from a different device', and then when you confirm etc, it usually sends you an email and asks whether you want to trust this device or not.

Obviously one could just set a cookie, one that maybe get's checked and logged each visit, but what about when the user signs out? Do we keep the cookie?

Is there any other reliable method to 'trust' a 'device' other than setting cookies? Or is this the best/most reliable way to do it?

asked 50 secs ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



What's the most reliable way to detect if the user is logging in from a different device than usual?

Alternative to single quote terminators for strings in SQL Server

Vote count: 0

I know in MySQL and a couple of other databases, you can use double quotes and single quotes, but it seems like double quotes are reserved for column names in SQL Server. In PHP, you can use <<<EOTs.

I'm writing a ton of queries that only have single quotes in the string values and it is becoming a nuisance to have to escape every single single-quote with an extra single quote. Is there an alternative to single quote terminators for strings?

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Alternative to single quote terminators for strings in SQL Server

Making a list with js

Vote count: 0

I am making an app that allows users to list movies. I have my Javascript working, but it's only letting me add just one thing. How can I make it so I can add multiple inputs to be posted?

In my html:

<!DOCTYPE html>
<html>
<link rel="stylesheet" text="text/css" href="movies.css">
  <head>
<script src="http://ift.tt/183v7Lz">
</script>

<title> 
Hello World 
    </title>
  </head>
  <body>
    <h1>My Favorite Movies</h1>
    <input type="text" id="movie" placeholder="Movie">
    <button id="enter">Enter</button>
    <div id="list">Chosen Films:</div>


<script type="text/javascript" src="movies.js"></script>
  </body>
</html>

and my Javascript:

$("#enter").click(
   function() {
     var movie = $("#movie").val();
     var list = (movie);
     $('#list').html(list);

 });

asked 2 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Making a list with js

How to set username and password of Firebase Data like MySQL

Vote count: 0

MySQL has user/pass to access one database, is there any way to set user/pass and ip address on Firebase for security purposes?? Then only specific website and user/pass can access My Firebase data.

asked 2 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



How to set username and password of Firebase Data like MySQL

laravel 5 blade template prints html as text

Vote count: 0

I have <p><strong>Some Body Lement&nbsp;Some Body Lement</strong></p> In database. I want to print in blade as html. but it prints as text

enter image description here

In my blade I have

@foreach( $articles as $article )
    <div class="recommended-info"><h3>{{ $article['title'] }}</h3></div>
    {{ $article['body'] }}
@endforeach

asked 1 min ago
Anri
1,043

1 Answer

Vote count: 0

If you don't want to escape the HTML, then you need to use the {!! !!} syntax. Example:

@foreach( $articles as $article )
    <div class="recommended-info"><h3>{{ $article['title'] }}</h3></div>
    {!! $article['body'] !!}
@endforeach

answered just now

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



laravel 5 blade template prints html as text

Sending and Receiving messages using Smack Api for Android

Vote count: 0

I'm trying since last four days to send and receive chat message using own XMPP and with Smack+OpenFire. According to Smack's "readme.txt' i set up the connection and got logged user in. The code of connection and login is this

public static String TAG = "Test connection";
private static XMPPTCPConnection connection;
private static String userName = "demo";
private static String Password = "demo";

static {
    // Create the configuration for this new connection
    XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder();
    configBuilder.setSecurityMode(XMPPTCPConnectionConfiguration.SecurityMode.disabled);
    configBuilder.setResource("");
    configBuilder.setUsernameAndPassword(userName, Password);
    configBuilder.setServiceName("192.168.2.10");
    configBuilder.setHost("192.168.2.10");
    configBuilder.setPort(5222);
    configBuilder.setCompressionEnabled(false);
    connection = new XMPPTCPConnection(configBuilder.build());
}

This way i configured the connectionbuilder. here i am connecting and signing in the user.

public class ConnectAndLogin extends AsyncTask<Void, Void, Void> {
    @Override
    protected Void doInBackground(Void... params) {
        try {
            connection.connect();
            Log.i(TAG, "Connected to " + connection.getHost());
        } catch (SmackException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (XMPPException e) {
            Log.e(TAG, "Failed to connect to " + connection.getHost());
            Log.e(TAG, e.toString());
            e.printStackTrace();
        }

        try {
            connection.login(userName, Password);
            Log.i(TAG, "Login as a : " + connection.getUser());
            setConnection(connection);
            setListner();
        } catch (XMPPException e) {
            e.printStackTrace();
            Log.i(TAG, "Login error " + e.toString());
        } catch (SmackException e) {
            e.printStackTrace();
            Log.i(TAG, "Login error " + e.toString());
        } catch (IOException e) {
            e.printStackTrace();
            Log.i(TAG, "Login error " + e.toString());
        }


        return null;
    }
}

In some tutorials that the addPacketListner must be set after login. i done that in setConnection() and some posts went through addAsyncStanzaListner. for send message

send.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Message msg = new Message("demo2", Message.Type.chat);
            msg.setBody("Hi how are you");
            if (connection != null) {
                try {
                    connection.sendPacket(msg);
                    Log.d("Send to room  : Name : ", "demo2");
                    Log.d("store", "store data to db");
                    //DBAdapter.addUserData(new UserData(text, "", "1" ,beam_id));
                } catch (Exception e) {
                    Log.d("ooo", "msg exception" + e.getMessage());
                }
            }
        }
    });

and for receiving messages this code

 public void setListner() {
    connection.addAsyncStanzaListener(new StanzaListener() {
        @Override
        public void processPacket(Stanza packet) throws SmackException.NotConnectedException {
            Message message = (Message) packet;
            Log.i(TAG, "REC : " + message.getBody());
            Log.i(TAG, "REC: " + message.getFrom());


        }

    }, new StanzaFilter() {
        @Override
        public boolean accept(Stanza stanza) {
            return false;
        }
    });
}

here is my dependencies

 compile 'org.igniterealtime.smack:smack-android:4.1.0'
compile 'org.igniterealtime.smack:smack-tcp:4.1.0'
compile 'org.igniterealtime.smack:smack-core:4.1.0'
compile 'org.igniterealtime.smack:smack-im:4.1.0'
compile 'org.igniterealtime.smack:smack-resolver-minidns:4.1.0'
compile 'org.igniterealtime.smack:smack-sasl-provided:4.1.0'

But still i'm not able to send messages to demo2 user. Where im doing wrong.Please guide and help me. Thanks

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Sending and Receiving messages using Smack Api for Android

Set a name for each ImageSource in a list. WindowsPhone 8.1

Vote count: 0

I call an API and get from there an id, a name and an URL for images...

I display them in a flipview and I used to convert them, saved them in a folder, convert them back and show them...

So I thought it would be much easier if I show them directly from their URL.

Now, when the user clicks (taps) on the image, it has to go to another page to show the detail of that image (and it was working fine, when saving the pic, since I named them by the id (id.png))

is there anyway I can name the ImageSource to be this id, or give it like a property (Title or Name)?

var pics = from special in GlobalVariables.Special
                       where special.special == "1"
                       select new { id = special.id, name = special.name, image = special.banner_image, featured = special.special };

            foreach (var item in pics)
            {
                await savePicToDisk(item.image, item.name, item.id, item.featured);
            }

So, then, instead of save them:

List<ImageSource> listOfImages = new List<ImageSource>();    

string url = "http://52.8.2.140" + picAddress;

                    ImageSource urlOfPic = new BitmapImage(new Uri(url, UriKind.Absolute));


                    listOfImages.Add(urlOfPic);

Then, where I have to show them, I just bind it to the flipview:

flipView1.DataContext = Classes.Special.listOfImages;

asked 2 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Set a name for each ImageSource in a list. WindowsPhone 8.1

Insert to all cells when records are more than one PHP

Vote count: 0

here is my big program!

freinds, all thing is ok but problem is in 'while' line and when i have more than one record.

here we connect to database and fetch information about users that got service of another users.

<form name="form2" method="post" action="" accept-charset='UTF-8'>
<?php
$id=$fgmembersite->UserID(); 
echo "$id"; ?>

<?php
$db_host = 'localhost';
$db_name= 'site';
$db_table= 'action';
$db_user = 'root';
$db_pass = '';


$con = mysql_connect($db_host,$db_user,$db_pass) or die("خطا در اتصال به پايگاه داده");
$selected=mysql_select_db($db_name, $con) or die("خطا در انتخاب پايگاه داده");
mysql_query("SET CHARACTER SET  utf8");

$dbresult=mysql_query("SELECT tablesite.name,
                          tablesite.family,
                          tablesite.username,
                          tablesite.phone_number,
                          tablesite.email,
                          action.service_provider_comment,
                          action.price,
                          action.date,
                          job_list.job_name,
                          relationofaction.ind
                   FROM  $db_table
                   INNER JOIN job_list
                   on job_list.job_id=action.job_id 
                   INNER JOIN relationofaction
                   on relationofaction.ind=action.ind
                   INNER JOIN tablesite
                   on tablesite.id_user=action.service_provider_id AND action.customer_id='$id'",$con);

here prints all times that current user got service of another user. it may be 0 or n.

problem is here. when services are more that 1 and when i am trying to insert informations to table, first choose of vote and explain inserts to all cells.

                   while($amch=mysql_fetch_assoc($dbresult))
{?>
<?php
echo'<div dir="rtl">';
echo "نام خدمت دهنده: "."&nbsp&nbsp&nbsp".$amch["name"]." ".$amch["family"]."&nbsp&nbsp&nbsp"."شماره تماس: ".$amch["phone_number"]."&nbsp&nbsp&nbsp"."ایمیل: ".$amch["email"].'<br>'.

"شغل انجام شده: ".$amch["job_name"].'<br>'
."تاریخ انجام عملیات: ".$amch["date"].'<br>'
."هزینه ی کار: ".$amch["price"]." تومان".'<br>'
.$amch["service_provider_comment"].'<hr/>';


   echo'<label for="explain">اگر توضیحاتی برای ارائه در این باره دارید، ارائه دهید</label> <br />';
   echo'<textarea name="explain" id="explain" cols="" rows="" style="width:300 ;height:300"></textarea>'.'<br/>'; 

echo'<label for="rate">امتیاز این عملیات را ثبت نمایید: </label> <br />';
echo '<select name="vote">';
echo '<option value="عالی">عالی</option>';
echo '<option value="عالی">خوب</option>';
echo '<option value="عالی">متوسط</option>';
echo '<option value="عالی">بد</option>';
echo '</select>';
echo'<br/>';
echo '<input type="submit" name="submit" value="ارسال نظر شما"/>';

echo'<hr/>';
echo'<hr/>';
echo'</div>';

}

?>

here we say if user clicked on button, send informations to table. once again i say all thing for one record is ok, problem when occure that we have more than one record and i now problem is in 'while' but i do not know how fix this problem.

<?php
if(isset($_POST['submit']))
{ 

$db_host = 'localhost';
$db_name= 'site';
$db_table= 'action';
$db_user = 'root';
$db_pass = '';

$con = mysql_connect($db_host,$db_user,$db_pass) or die("خطا در اتصال به پايگاه داده");

mysql_query("SET NAMES 'utf8'", $con);
mysql_query("SET CHARACTER SET 'utf8'", $con);
mysql_query("SET character_set_connection = 'utf8'", $con);

$selected=mysql_select_db($db_name, $con) or die("خطا در انتخاب پايگاه داده");
$ins ="UPDATE $db_table
SET 
customer_comment='" . mysql_escape_string($_POST['explain']) . "',
vote='" . mysql_escape_string($_POST['vote']) . "'
WHERE ind=ind";
$saved=mysql_query($ins );
mysql_close($con); 


echo '<script language="javascript">';
echo 'alert("نظر شما با موفقیت ثبت شد")';
echo '</script>';
echo '<script>window.location.href = "action_perfomed_agree.php";</script>';
}
?>

here all information sends to table but if more than one record, will wrong.

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Insert to all cells when records are more than one PHP

Multiple select tags in one dropdown

Vote count: -1

I have a number of select tags (allowing multiple selections) in a row, which do not look great on desktop or mobile devices.

I found this tool at Newseum

http://ift.tt/1MeS57J

I like its "Filter and Sort", which exactly meets my needs. Attached is the screenshots of how it works.

My question: is there any tool like this available for me to re-use? It appears to me it is no small task to recreate everything.

Thanks for any pointers and how-to ideas!

Regards.enter image description here

asked 1 min ago
curious1
2,744

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Multiple select tags in one dropdown

Clear stored video in MediaStreamRecorder after ondataavailable while still recording?

Vote count: 0

When I'm recording video in the browser using MediaStreamRecorder (OSX 10.11.1/Windows 10, Firefox 41/Chrome 46) I get out of memory errors (MacBook Air, 4GB RAM) in Firefox after half an hour of recording, even though I'm handling the data every second within the ondataavailable event (See my other question for details and code). Chrome works for more than an hour, but it too has increasing memory usage over time.

I suppose the browser is not discarding the recorded video after the event (which usually makes sense, I never told it to discard any video data). Is there any way I can trigger a cleanup? I'm not interested in video data after the event.

asked 1 min ago
grefab
1,183

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Clear stored video in MediaStreamRecorder after ondataavailable while still recording?

Where should I store queryset.values_list for faster access?

Vote count: 0

I have a big model of around 3M rows, which is not changed frequently. I am trying to optimize the queries.

frequent queries are made on the model where the queries are finite and are repeated,

I want to store the values_list of the querysets to somewhere to search the objects faster.

Where is should I store the list?

The list looks something like this,

values = [u'value 0', u'value 1', u'value 2', u'value 3', ..., u'value n-1']

Should I use just the Django Cache framework or what could be the alternatives to store keys/values so searching can be faster?

Can accessing a cached queryset.values_list() be faster than generating the values_list on every request (my server takes around 0:00:00.002984)?

I have very little experience with external caching tools like redis, but with the django filesystem cache.

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Where should I store queryset.values_list for faster access?

angularjs passing value for object

Vote count: 0

$scope.passingValueForObject = function(which, value) {
  $scope.object.which.push(value);
}

I want use "which" to push that want index. how to do that?

asked 9 mins ago

3 Answers

Vote count: 0

$scope.object.which = []
$scope.passingValueForObject = function(which, value) {
  $scope.object.which.push(value);
}

answered 1 min ago

Vote count: 0

Use the following syntax where "which" is the key of the object:

$scope.object[which].push(value);

answered 1 min ago

Vote count: 0

Well, if it's only one object, you can just do this:

var ctrl = this;

this.passingValueForObject = function(obj, value) {
  ctrl.obj.attr = value;
}

Now, if we're talking about an array of objects, you can do this:

var ctrl = this;

this.objs = [ obj1{}, obj2{} ];

this.passingValueForObject = function(objs, index, value) {
  ctrl.objs[index].attr = value;
}

answered 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



angularjs passing value for object

I am having error to display the image file save in memory in android,

Vote count: -2

Here is the code :- public void Displayimg(View v) {

    File path = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "MyCameraApp");


    ipath[0] = String.valueOf(((TextView) v).getText());


    String  sifile = ipath[0].substring(45,52);  // extracting the filename from the view eg: abc.jpg


    File imgfile = new File(path,sifile);  // it fails on this line with unfortunately, main application has stopped. 

// if the sifile conatians a name of the file that exist, it give error and comes out // if I give file name in sifile that does not exisit, if give file does on exisit and comes our with error. // Basically I am having problem to open an image file that exisit and dispaly.

    // File("/storage/sdcard0/Pictures/MyCameraApp/Zimg20151105_1535133.Jpg");



    Bitmap myBitmap = BitmapFactory.decodeFile(file.getAbsolutePath());

    ImageView myImage = (ImageView) findViewById(R.id.mc_imgview);

    if(imgfile.exists()){

        Toast.makeText(getApplicationContext(),file.getAbsolutePath() + "File Exisit", Toast.LENGTH_SHORT).show();
        myImage.setImageBitmap(myBitmap);
    }
    else
    {
        Toast.makeText(getApplicationContext(),file.getAbsolutePath() + " File Does not Exisit", Toast.LENGTH_SHORT).show();
    }


}

asked 9 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



I am having error to display the image file save in memory in android,

iOS - Save png with RGB or ARGB color space

Vote count: 0

I need to save an input png image with RGB or ARGB color space. I managed to remove transparency, obtaining an image with a black background but it still has alpha channel. Any advice?

asked 2 mins ago
laucel
284

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



iOS - Save png with RGB or ARGB color space

Python scan for network IP addresses and macs

Vote count: 0

I am trying to create a script that scans a LAN and obtains the ip address and mac address of all the machines using Python. The script below does this, however it prints the list twice? How could this be achieved, or how could the script below be changed to print the list once(as a dictionary where the ip address is the key and the mac is the value)?

from __future__ import absolute_import, division, print_function
import logging
import scapy.config
import scapy.layers.l2
import scapy.route
import socket
import math
import errno

logging.basicConfig(format='%(asctime)s %(levelname)-5s %(message)s', datefmt='%Y-%m-%d %H:%M:%S', level=logging.DEBUG)
logger = logging.getLogger(__name__)


def long2net(arg):
    if (arg <= 0 or arg >= 0xFFFFFFFF):
        raise ValueError("illegal netmask value", hex(arg))
    return 32 - int(round(math.log(0xFFFFFFFF - arg, 2)))


def to_CIDR_notation(bytes_network, bytes_netmask):
    network = scapy.utils.ltoa(bytes_network)
    netmask = long2net(bytes_netmask)
    net = "%s/%s" % (network, netmask)
    if netmask < 16:
        logger.warn("%s is too big. skipping" % net)
        return None

    return net


def scan_and_print_neighbors(net, interface, timeout=1):
    logger.info("arping %s on %s" % (net, interface))
    try:
        ans, unans = scapy.layers.l2.arping(net, iface=interface, timeout=timeout, verbose=True)
        for s, r in ans.res:
            line = r.sprintf("%Ether.src%  %ARP.psrc%")
            try:
                hostname = socket.gethostbyaddr(r.psrc)
                line += " " + hostname[0]
            except socket.herror:
                # failed to resolve
                pass
            logger.info(line)
    except socket.error as e:
        if e.errno == errno.EPERM:     # Operation not permitted
            logger.error("%s. Did you run as root?", e.strerror)
        else:
            raise


if __name__ == "__main__":
    for network, netmask, _, interface, address in scapy.config.conf.route.routes:

        # skip loopback network and default gw
        if network == 0 or interface == 'lo' or address == '127.0.0.1' or address == '0.0.0.0':
            continue

        if netmask <= 0 or netmask == 0xFFFFFFFF:
            continue

        net = to_CIDR_notation(network, netmask)

        if interface != scapy.config.conf.iface:
            # see http://ift.tt/1HtLdBa
            logger.warn("skipping %s because scapy currently doesn't support arping on non-primary network interfaces", net)
            continue

        if net:
            scan_and_print_neighbors(net, interface) 

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Python scan for network IP addresses and macs

Android|Play audio files acquired from my database

Vote count: 1

I have a question regarding mediaplayer for android app. I would like to play audio files by HTTP streaming acquired from my database.

I already retain the audio file URL by the getStringExtra method.

DetailActivity.java

Intent intent = getIntent();
String audioGuide = intent.getStringExtra("audioGuide");

Could anyone help me how to play "audioGuide" by mediaplayer?

In addition, I want the process will be below;

After tapping audioButton,the audioplayer will start.Then tapped again,the audio will stop. (I'd like to change the playbutton to pause button contained in my drawable.)

activity_detail.xml

<ImageView
android:id="@+id/audioButton"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_gravity="center"
android:onClick="onAudioButton"
android:src="@drawable/play_button"/>

Sorry for if my poor english confuses you. Thank you.

asked 9 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Android|Play audio files acquired from my database

Visual Studio web profiling only shows iexplore

Vote count: 1

When I run the Visual Studio 2012 profiler (Perfomance Analyzer) for a web app inside Visual Studio, it starts Internet Explorer and ends profiling when I close the IE window.

But after the analysis, results only show the iexplore.exe process and its internal calls, with no indication of how my assemblies are performing.

How can I configure the analyzer to profile my code? For desktop apps, it works without problems.

asked 10 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Visual Studio web profiling only shows iexplore

Exclusive access to read a message from Websphere MQ 7, proccess it then delete it

Vote count: 0

I have a queue form which i'd like to be able to retrieve message. I then need to process them somehow (not in the scope) and then remove them from the queue.

I tried to create 2 queues, one that browse the message and one to delete the message after it has been processed.

    MQQueue browseQueue = qMgr.AccessQueue(QUEUE_NAME, MQC.MQOO_BROWSE);
    MQGetMessageOptions browseOptions = new MQGetMessageOptions()
    {
        Options = MQC.MQGMO_WAIT | MQC.MQPMO_FAIL_IF_QUIESCING | MQC.MQGMO_BROWSE_NEXT,
        WaitInterval = MQC.MQWI_UNLIMITED
    };

    MQQueue acknowledgeQueue = qMgr.AccessQueue(QUEUE_NAME, MQC.MQOO_INPUT_AS_Q_DEF);
    MQGetMessageOptions acknowledgeOptions = new MQGetMessageOptions()
    {
        Options = MQC.MQGMO_WAIT | MQC.MQPMO_FAIL_IF_QUIESCING | MQC.MQMO_MATCH_MSG_ID,
        WaitInterval = MQC.MQWI_UNLIMITED
    };

    while (keepRunning.WaitOne(0))
    {
        MQMessage browseMessage = new MQMessage();

        try
        {
            browseQueue.Get(browseMessage, browseOptions);
        }
        catch (MQException mqexe)
        {
            throw;
        }

        if (browseMessage.MessageType != ShutDown.TYPE)
        {
            object o = browseMessage.ReadObject();
            Console.WriteLine("The message is: {0}", o);
        }

        browseMessage.ClearMessage();

        MQMessage acknowledgeMessage = new MQMessage()
        {
            MessageId = browseMessage.MessageId
        };
        acknowledgeQueue.Get(acknowledgeMessage, acknowledgeOptions);
    }

But I need to make sure no other process can access the same message. Since, I relied on using 2 queues, I don't see how to do it.

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Exclusive access to read a message from Websphere MQ 7, proccess it then delete it

Is Printer Available?

Vote count: 0

I am using XCode/Ionic and Cordova to build an hybrid application. In the application I allow the user to set the IP of his printer. Now when I print I need to make sure that the printer is online. Is there a way to do a quick test to see if the printer is online? Maybe I can do a ping in xcode?

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Is Printer Available?

I am trying to display the Label and the value of a custom field type in wordpress

Vote count: 0

I have created a custom post type which contains multiple custom fields.

I am trying to display the Label (not the field name) and the Value of each of the custom fields on the post.

So on the front-end display it would show

Self Catering: Yes

Weddings: Yes

ect ect...

I am trying this code without much luck throwing an error.

<?php 
   $field_name = "self_catering";
   $field = get_field_object($field_name);
   echo '<b>' . $field['label'] . ':</b> ' . $field['value'];
?>

Hope someone can shed some light.

Thanks

asked 3 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



I am trying to display the Label and the value of a custom field type in wordpress

PerformClick does not work correctly

Vote count: 0

I am trying to make a dialog like a tooltip using EasyDialog.

When I show this dialog open with clicking button, everything works fine.

But the problem is when I want to show this dialog at start of the activity.

I tried to show dialog by using button.performClick(). I put toast to make sure that the onClickListener is calling. The result was that, The toast are shoeing normally but the dialog does not.

When I debug the program, I see that these lines of code are executing but I can't understand why the dialog does not display.

Note that the library I use to show the dialog is Here.

Here is the code :

    btnBottomLeft = (Button) findViewById(R.id.btnBottomLeft);
    btnBottomLeft.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Toast.makeText(this, "HERE", Toast.LENGTH_LONG).show();
            new EasyDialog(MainActivity.this)
                    .setLayoutResourceId(R.layout.layout_tip_image_text)
                    .setBackgroundColor(MainActivity.this.getResources().getColor(R.color.background_color_yellow))
                    .setLocationByAttachedView(btnBottomRight)
                    .setGravity(EasyDialog.GRAVITY_TOP)
                    .setAnimationTranslationShow(EasyDialog.DIRECTION_X, 300, 400, 0)
                    .setAnimationTranslationShow(EasyDialog.DIRECTION_Y, 300, 400, 0)
                    .setAnimationTranslationDismiss(EasyDialog.DIRECTION_X, 300, 0, 400)
                    .setAnimationTranslationDismiss(EasyDialog.DIRECTION_Y, 300, 0, 400)
                    .setTouchOutsideDismiss(true)
                    .setMatchParent(true)
                    .setMarginLeftAndRight(24, 24)
                    .setOutsideColor(MainActivity.this.getResources().getColor(R.color.outside_color_trans))
                    .show();
        }
    });
    btnBottomLeft.performClick();

So, problem is that, the dialog opens correctly by clicking button.

but btnBottomLeft.performClick() just show the toast, not the dialog.

What should I do to make dialog open??

Can anyoe please help me?? Thanks in advance

asked 3 mins ago
TTS
6

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



PerformClick does not work correctly

R: Speed up API calls

Vote count: 0

I am writing code to collect data from the Steam API (documentation: http://ift.tt/1nlgDl9).

Particularly, I use the fromJSON() function from the jsonlite package in [R].

However, I have the feeling that the code is slow, and that the bottleneck is the actual calling of the API. I am currently able to do around 7.500-10.000 calls an hour, resulting in around 2-3 calls per second. This feels slow. Is it possible to speed this up, and if so, how?

Two things I found already is that it may be necessary to close the connection after opening it (cf. http://ift.tt/1PcHM9Q). Also, the API allows json (what I use now) but also XML and CSV outputs, maybe it is better to use one of the latter two? Any other possible solutions?

asked 35 secs ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



R: Speed up API calls

This url has been identified as malicious and/or abusive for herokuapp.com

Vote count: 0

I created a new app in Facebook Developers, and Im trying to set Site Url, but when I tried with my app hosted in heroku, I got this error:

This url has been identified as malicious and/or abusive.

I tried to change the subdomain for other and I get the same error, for example (http://ift.tt/1qLs7Qc). Also I create a new Developer account and Im still getting the same error!

Some idea? Thanks!

asked 26 secs ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



This url has been identified as malicious and/or abusive for herokuapp.com

PHP write new file in apache localserver

Vote count: 0

I'm having problems to create a new file from a parsed previous one. I have this code in javascript/jQuery (a piece of it):

$('#button').live('click', function (e) {
        var file_name_srt_URL = 'folder_one/' + file_name_
        translatedLanguage = $('#input_text').val();
        var lang_from = shortLanguage(originalLanguage);//it's simple function, does something like: originalLanguage = english -> return 'en'
        var lang_to = shortLanguage(translatedLanguage);
        var jsonNameFile = JSON.stringify(file_name_srt_URL);
        var jsonLangFrom = JSON.stringify(lang_from);
        var jsonLangTo = JSON.stringify(lang_to);

        $.ajax({
            type: "POST",
            url: "traduction.php",
            data: {data: jsonNameFile, langFrom: jsonLangFrom, langTo: jsonLangTo}, 
            cache: false,

            success: function(){
                alert("Success!");
                hideMsgBox();
            }
        });
    });

And now, the PHP Code:

<?php
define('SRT_STATE_SUBNUMBER', 0);
define('SRT_STATE_TIME',      1);
define('SRT_STATE_TEXT',      2);
define('SRT_STATE_BLANK',     3);

libxml_use_internal_errors(true);
function translate($text, $from, $to){
    //fake user-agent
    ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3');
    ini_set('default_charset', 'utf-8');//set encoding in case it's other than utf-8 (you might need to re-set it afterwords)
    $get_string = 'hl=' . $from . '&tl=' . $to . '&q=' . urlencode($text);
    $data = file_get_contents('http://ift.tt/vdS1S2?' . $get_string);
    $DOM = new DOMDocument;
    $DOM->loadHTML($data);
    $items = $DOM->getElementById('result_box');
    return $items->nodeValue;
}
$file_name = json_decode($_POST['data']); //original filename route 
$lang_from = json_decode($_POST['langFrom']); //original language
$lang_to = json_decode($_POST['langTo']); //final language to translate

$url_to = 'new/'; //directory to save the new file
$_file_srt = str_replace("folder_1/", "$url_to", $file_name); //substitution Old Directory for the New one
$new_file_srt = str_replace("$lang_from","$lang_to",$_file_srt); //substitution old language for the new one on the extension file
$saveToFile = $url_to . $new_file_srt; //final name: URL + Filename

$subs    = array();
$state   = SRT_STATE_SUBNUMBER;
$subNum  = 0;
$subText = '';
$subTime = '';
$space = "\n";
$blank = " ";
$arrow = " --> ";

$lines   = file($file_name); //read file
foreach($lines as $line) {
    switch($state) {
        case SRT_STATE_SUBNUMBER:
            $subNum = trim($line);
            $state  = SRT_STATE_TIME;
            break;

        case SRT_STATE_TIME:
            $subTime = trim($line);
            $state   = SRT_STATE_TEXT;
            break;

        case SRT_STATE_TEXT:
            if (trim($line) == '') {
                $sub = new stdClass;
                $sub->number = $subNum;
                list($sub->start, $sub->end) = explode(' --> ', $subTime);
                $sub->text   = $subText;
                $subText     = '';
                $state       = SRT_STATE_SUBNUMBER;

                $subs[]      = $sub;
            } else {
                $subText .= $line;
            }
            break;
    }
}

if (isset($file_name))
{
    $h = fopen($saveToFile, 'w+');
    if ($h) {
        foreach ($subs as $sub) {
            fwrite($h,$sub->number);
            fwrite($h,$space);
            fwrite($h,$sub->start);
            fwrite($h,$arrow);
            fwrite($h,$sub->end);
            fwrite($h,$space);
            //fwrite($h,translate($sub->text,$lang_from,$lang_to));
            fwrite($h,$sub->text);
            fwrite($h,$space);
            //fwrite($h,$space);
        }
        fclose($h);
    }
    exit('Data Saved.');
}
?>

My problem is no file is created at any directory, I don't know why, because I did this things before with other files, but now I can't find the problem!

Any one can help me? Thank you!

asked 29 secs ago
Sergi
104

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



PHP write new file in apache localserver

Phoenix: string interpolation inside eex file

Vote count: 0

I'm trying to pass variables inside Phoenix EEx templates. So far, so good, but I'm not handling this simple string interpolation:

<a href="<=% @url %>" class="core secondChild Item">

I want the equivalent in Javascript to:

<a href="'+<=% @url %>+'" class="core secondChild Item">

so that I can pass url as a variable when calling the template an build a URL inside the href="".

asked 19 secs ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Phoenix: string interpolation inside eex file

Docker separate containers for node, mongo, how to populate mongo from node container

Vote count: 0

I have two docker containers, one to run my node server, and another to run mongo.

What i'm trying to do is when I install my mongo image, i need it to use node.js to populate mongo with a script i have.

What is the best approach to do this with separate containers for mongo, and node.js?

Currently my thought is that when I create my mongo container, i install node and run my populate script as a RUN command.

Is there a better approach to this?

asked 20 secs ago
Catfish
5,385

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Docker separate containers for node, mongo, how to populate mongo from node container

Java - Better way to split a string into just one array

Vote count: 0

I only want the first element from s.split(",") and I need to return value to be in a String array.

How can I make this code a one liner?

String [] sd = s.split(",");
String [] sf = new String[]{sd[0]};

I tried s.split(",",1); but it just adds it all to the first element without actually splitting it.

asked 20 secs ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Java - Better way to split a string into just one array

XMLArray with different types but same element name and i:type attribute

Vote count: 0

I am trying to serialize some data I have into this XML format but not able to achive the same.

The Desired XML output is below:

<?xml version="1.0" encoding="utf-8"?>
<Root xmlns:i="http://ift.tt/ra1lAU">
  <Datas>
    <Data xmlns="" i:type="DataA">
      <Name>A1</Name>
      <ADesc>Description for A</ADesc>
    </Data>
    <Data xmlns="" i:type="DataB">
      <Name>B1</Name>
      <BDesc>Description for b</BDesc>
    </Data>
  </Datas>
</Root>

The Classes I created for serialization are as follows:

public class Data
{
    [XmlElement("Name")]
    public string Name { get; set; }
}

public class DataA : Data
{
    [XmlElement("ADesc")]
    public string ADesc { get; set; }
}

public class DataB : Data
{
    [XmlElement("BDesc")]
    public string BDesc { get; set; }
}

[XmlRoot("Root")]
public class Root
{
    [XmlArray("Datas")]
    [XmlArrayItem(Type = typeof(Data))]
    [XmlArrayItem(Type = typeof(DataA))]
    [XmlArrayItem(Type = typeof(DataB))]
    public List<Data> Datas { get; set; }
}

I use the below method for serializing:

internal static string Serialize(Root obj)
{
    var ns = new XmlSerializerNamespaces();
    ns.Add("i", "http://ift.tt/ra1lAU");

    XmlSerializer xmlSerializer = new XmlSerializer(typeof(Root));

    using (StringWriter textWriter = new StringWriter())
    {
        xmlSerializer.Serialize(textWriter, obj, ns);
        return textWriter.ToString();
    }
}

But the output I get is this (which is not correct):

<?xml version="1.0" encoding="utf-8"?>
<Root xmlns:i="http://ift.tt/ra1lAU">
  <Datas>
    <DataA>
      <Name>A1</Name>
      <ADesc>Description for A</ADesc>
    </DataA>
    <DataB>
      <Name>B1</Name>
      <BDesc>Description for b</BDesc>
    </DataB>
  </Datas>
</Root>

asked 22 secs ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



XMLArray with different types but same element name and i:type attribute

A weird place of my iframe in my codeplayer

Vote count: 0

I got a problem with my iframe. On the top there is a bar. On the left I got a textarea for putting in HTML and i got also two textarea's for putting in CSS and JS but they had a display:none. Then i want on the left an iframe where i can see the result of everything i had put in. But the iframe is everythime beneath the textarea for HTML. I have tried to change the positioning of my iframe but when i make my window bigger he is on a total other place. I gonna set my whole code because it's possible that i make a mistake in a other thing

<script>


                 var height=$(window).height()-40;

                 $(".codecontainer").height(height+"px");

 </script>
<!doctype html>
<html>
<head>
 <title>CodePlayer</title>
 <meta charset="utf-8" />
 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1" />

        <script src="http://ift.tt/1dLCJcb"></script>

        <script src="http://ift.tt/1LrXp9A"></script>

        <style>
                * {
                                 font-family: "HelveticaNeue-Light", "Helvetica Neue Light",
                "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
                                 margin:0;
                                 padding:0;
                }
                                
                body, html {
                                 height:100%;
                                 width:100%;
                }
                #container {
                                 height:100%;
                }
                                
                 #titlebar {
                         width:100%;
                         background-color:#EEEEEE;
                         border-bottom:1px solid grey;
                         height:40px;
                 }

                 #title {
                         padding:10px 0 0 20px;
                         font-weight:bold;
                         float:left;
                 }

                 #menu {
                         margin:0 auto;
                         width:220px;
                         padding:5px;
                 }
                 
                #menu ul {
                         border:1px solid grey;
                         border-radius:5px;
                         height:30px;
                 }

                 #menu li {
                         float:left;
                         list-style:none;
                         border-right:1px solid grey;
                         height:20px;
                         padding:5px 10px;
                 }

                 #menu li:hover {
                         background-color:grey;
                 }

                 #result{
                        position: relative;
                        top: -30px;
                        left: 153px;
                        border-right: 1px solid white;
                 }

                 #runButton{
                        float: right;
                        position: relative;

                 }

                 #run{
                        padding: 10px 15px 10px 15px;
                        border:none;
                        border-radius: 10px;
                 }

                 #run:hover{
                         background-color:grey;
                 }

                 .break {
                        clear:both;
                 }

                 .codecontainer{
                         width:49%;
                         float:left;            
                         position:relative;
                         top: -24px;
                         height: 100%;
                 }

                 .codecontainer textarea{
                        width: 100%;
                        height: 100%;
                        border:none;
                        border-right: 1px solid grey;
                        font-family: monotype;
                        font-size: 120%;
                        padding:4px;
                 }

                 .codeLabel{
                        border:1px grey solid;
                        width: 50px;
                        position: absolute;
                        top: 20px;
                        right: 10px;
                        padding: 5px 5px 5px 5px;
                        border-radius: 5px;
                 }

                 #cssContainer, #jsContainer{
                        display: none;
                 }

                 iframe{
                        height: 100%;
                        width: 100%;
                        margin: 0;
                        float: left;
                 }

        </style>
         
</head>
<body>
        <div id="container">
                <div id="titlebar">
                        <div id="title">
                                         CodePlayer
                        </div>
                                        
                        <div id="runButton">
                                                
                                         <button id="run">Run</button>
                                        
                        </div>
                                        
                        <div id="menu">
                                         <ul>
                                                 <li>HTML</li>
                                                 <li>CSS</li>
                                                 <li>JS</li>
                                                 <li style="border:none" id="result">Result</li>
                                         </ul>
                        </div>
                                        
                                        
                                        
                </div>
                                        
                <div class="break"></div>
                                        
                <div class="codecontainer" id="htmlContainer">

                        <span class="codeLabel">HTML</span>

                        <textarea>Example code</textarea>

                <div class="codecontainer" id="cssContainer">

                        <span class="codeLabel">CSS</span>

                        <textarea>Example code</textarea>
                                        
                </div>

                <div class="codecontainer" id="jsContainer">

                        <span class="codeLabel">JS</span>

                        <textarea>Example code</textarea>
                                        
                </div>

                <div class="codecontainer" id="resultContainer">

                        <span class="codeLabel">Result</span>

                        <iframe></iframe>
                                        
                </div>

        </div>
</body>
</html>
asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



A weird place of my iframe in my codeplayer

Count the number of elements different in one set than the other

Vote count: 0

The set_difference algorithm gives you output of elements which are in the first range and not in second. Is there a algorithm which will just give me the count and not the difference.

I understand I can implement my own version of the algorithm described in the link or I can count the number of elements after I get the result. Is there a existing API which will do it for me efficiently.

Thanks

asked 2 mins ago
gudge
374

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Count the number of elements different in one set than the other

iOS video player with custom url

Vote count: 0

I need to play video file by url in my iOS application. I have an URL to video file on the remote server. But there is a problem with playing it using default MPMoviePlayer: to get access to this file we need to use custom http header (Authorization in this case). How can I do this?

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



iOS video player with custom url

Antlr failed to create lookahead

Vote count: 0

I have a grammar that is not really super clean considering the notation therefore I have to turn on backtracking for it
(I know that this is not the best solution but as my grammar is being generated by a program I write and fixing these parts will take me a lot time for debugging but that's not the topic here).

However when I try to generate my grammar via the Mwe2 workflow it gives me this error message:

error(10):  internal error: org.antlr.tool.Grammar.createLookaheadDFA(Grammar.java:1279): could not even do k=1 for decision 92; reason: timed out (>100000ms)

As I have read here this may be because Antlr just needs more time for compiling...
My question is if it would be sufficient to just increase the time Antlr can take to generate (and if yes how to do this) or if this may have other reasons such as an endless loop during creation or something similar...

Note: My grammar is almost 3000 lines long

Thanks in advance
Raven

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Antlr failed to create lookahead

In Weka - why is my REPTree is so small?

Vote count: 0

I generated a REPTree but it seems too small, missing a lot of attributes.

I tried setting

setMinVarianceProp(1e-6)

but it had no effect. What else could be wrong?

asked 1 min ago
Alex R
2,502

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



In Weka - why is my REPTree is so small?

Antscript should run after Order Number

Vote count: 0

I have 3 Task to perform in my script. This are 3 copy-Task. Every task have one "Step". This is the Order i want to perform the Task. But actual this Step is not relevant. They run after a hard Order. Now i want they to run in these three steps. Maybe Step 1 must be step 3. I Only want to change this Numbers and the script runs after it. The script must watch the order number before it runs or something else. But i dont know to do it. Maybe you can help? Thanks Greetings Fl33xx

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Antscript should run after Order Number

Printing out a rhombic pattern in java with "for" loop

Vote count: 0

I am having a hard time doing a school exercise in Java. We are asked to print out this pattern:

+++++++++++++++++++++++++++++++++++++++++++++
 +++++++  +++++++  +++++++  +++++++  +++++++ 
  +++++    +++++    +++++    +++++    +++++  
   +++      +++      +++      +++      +++   
    +        +        +        +        +    
   +++      +++      +++      +++      +++   
  +++++    +++++    +++++    +++++    +++++  
 +++++++  +++++++  +++++++  +++++++  +++++++ 
+++++++++++++++++++++++++++++++++++++++++++++
 +++++++  +++++++  +++++++  +++++++  +++++++ 
  +++++    +++++    +++++    +++++    +++++  
   +++      +++      +++      +++      +++   
    +        +        +        +        +    
   +++      +++      +++      +++      +++   
  +++++    +++++    +++++    +++++    +++++  
 +++++++  +++++++  +++++++  +++++++  +++++++ 
+++++++++++++++++++++++++++++++++++++++++++++
 +++++++  +++++++  +++++++  +++++++  +++++++ 
  +++++    +++++    +++++    +++++    +++++  
   +++      +++      +++      +++      +++   
    +        +        +        +        +    
   +++      +++      +++      +++      +++   
  +++++    +++++    +++++    +++++    +++++  
 +++++++  +++++++  +++++++  +++++++  +++++++ 
+++++++++++++++++++++++++++++++++++++++++++++

I can do a triangle, or an hourglass shape,but I can't get it to repeat horizontally.

This is what I have up to now:

    int a = 9;
    char b = '+';
    char c = ' ';

    int i_buffer = a;
    int i_leer = 1;
    for( int i = 0; i < a; i++ ){

        for( int z = i_buffer; z > 0; z--)
        System.out.print( b );

    System.out.println();

    i_buffer = i_buffer - 2;
    if( i_buffer < 0 )
        break;

        for( int z = i_leer++; z > 0; z--)
        System.out.print( c );

    }

Any help is appreciated

asked 43 secs ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Printing out a rhombic pattern in java with "for" loop

WCF cannot create custom endpointbehavior only in PROD environment

Vote count: 0

I have a WCF rest web service. Everything works fine on my development environment (#develop using IIS express), but i get the following error on my production evironment:

Server Error in '/Services' Application. --------------------------------------------------------------------------------

Configuration Error 
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: An error occurred creating the configuration section handler for system.serviceModel/behaviors: Extension element 'inspectMessageBehavior' cannot be added to this element.  Verify that the extension is registered in the extension collection at system.serviceModel/extensions/behaviorExtensions.
Parameter name: element

Source Error: 


Line 16:            </service>
Line 17:        </services>
Line 18:        <behaviors>
Line 19:            <endpointBehaviors>
Line 20:                <behavior name="webHttp">


Source File: C:\Otimis\AdvLinkForWebService\services\web.config    Line: 18 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 

This is my web.config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <services>
            <service name="AdvLinkForWebService.inbound">
                <endpoint address=""
                          binding="webHttpBinding"
                          contract="AdvLinkForWebService.Iinbound"
                          behaviorConfiguration="defaultWebHttpBehavior"/>
            </service>
            <service name="AdvLinkForWebService.config">
                <endpoint address=""
                          binding="webHttpBinding"
                          contract="AdvLinkForWebService.Iconfig"
                          behaviorConfiguration="webHttp"/>
            </service>
        </services>
        <behaviors>
            <endpointBehaviors>
                <behavior name="webHttp">
                    <webHttp/>
                </behavior>
                <behavior name="defaultWebHttpBehavior">
                    <inspectMessageBehavior/>
                </behavior>
            </endpointBehaviors>
        </behaviors>
        <extensions>
            <behaviorExtensions>
                <add name="inspectMessageBehavior"
                     type="AdvLinkForWebService.MessageInspector.InspectMessageBehaviorExtension, AdvLinkForWebService"/>
            </behaviorExtensions>
        </extensions>
    </system.serviceModel>
</configuration>

This question is related to this one

asked 47 secs ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



WCF cannot create custom endpointbehavior only in PROD environment

Always get "The resulting API analysis file is too large."

Vote count: 0

When I submitting to iTunes Connect I always get this message:

iTunes Store operation succeeded with a warning.

The resulting API analysis file is too large. We were unable to validate your API usage prior to delivery. This is just an informational message.

enter image description here

And all builds stuck in "processing" state for a long time. enter image description here

I know that on stackoverflow exist similar questions, but there no solution to fix it. Please don't mark my question as duplicate.

asked 2 mins ago
ChikabuZ
2,662

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Always get "The resulting API analysis file is too large."

Difference in Angulad CND version creating unwanted result

Vote count: 0

I had the following code in angular.

<html>
    <head>
        <title>AngularJS</title>
    </head>
    <body>
        <div ng-app="" ng-controller="studentController">

        <p>Enter your first name <input type="text" ng-model="student.firstName"><br>
        <p>Enter your last name <input type="text" ng-model="student.lastName"><br>
        <br>

        You are entering: {{student.fullName()}}
       </div>
       <script>
        function studentController($scope) {
            $scope.student = {
                firstName: "",
                lastName: "",
                fullName: function() {
                    var studentObject;
                    studentObject = $scope.student;
                    return studentObject.firstName + " " + studentObject.lastName;
                }
            };
        }
         </script>
         <script src="http://ift.tt/1AFpghH"></script>    
    </body>
</html> 

However, the webpage rendered produced two input boxes and the text {{student.fullName()}}. On replacing the CDN address from 1.3.5 to 1.2.15 solves the problem and produces the desired output. Is the above code( or a part) obsolete ?

asked 2 mins ago
aman
18

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Difference in Angulad CND version creating unwanted result

How to access data from txt or pdf file into java code for condition checking

Vote count: 0

 this is   x.txt 
 file     
    12=aa
    1234=ytuu
    157=lkjh

    // above is the sample of data(from 7700 similiar lines in actual file) in a txt file . i want to use that data for condition checking in my java code like 

    if (n==12){
     System.out.println("aa");}
    else
    if (n==1234){
     System.out.println("ytuu");}

is there any way to access these data rather than typing all the lines into my code.if so , how ? i am a beginner so please help me with this one.

asked 3 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



How to access data from txt or pdf file into java code for condition checking

Print from starmap_async() pool worker

Vote count: 0

I'd like to throw out some basic status text from my pool workers, but I'm not getting any joy on the shell. I do get the return value of the function, when a worker has finished. But the print(q) outputs nothing.

The effect is identical if i replace starmap_async() with regular map_async() and unpack the q, p input inside le_funk().

This is a basic mock-up of what I'm trying to do:

import multiprocessing as mp

def le_funk(q,p):
    print(q)
    return(q+p)


if __name__ == '__main__':
    with mp.Pool(maxtasksperchild=1) as pool: 
        arg = [('a','b'), ('e','f'), ('i','j'), ('o','p'), ('u','v')]
        res = pool.starmap_async(le_funk, arg)
        # Stay calm and wait for workers to finish.
        res.wait()
        print(res.get())

I've seen it done here so apparently its possible. They just use the older non-with setup but either gives no print output in my python 3.5 windows terminal.

asked 3 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Print from starmap_async() pool worker

xml parsing in golang (i want to access each element in the details individually )

Vote count: 0

my xml data dxml := <cm> <id>TASK_DATA_RES</id> <task> <swid>3873-0</swid> <detail> <![CDATA[<execute name="EXECUTE">
<swid>3873</swid> <tskid>MONITOR0</tskid> <file_name>DiskStatusCheck.ps1</file_name> <param>/metricName::metric_3873_48 /metric::DiskStatusCheck /warn::1 /critical::1 /alert::1 /params::E:</param> <timeout></timeout> <user>test\\test</user> <passwd>test</passwd> <path>http://ift.tt/1kvM13k; <pathtype>local</pathtype> <size>9147</size> <encoded_size>9147</encoded_size> <type>POWERSHELL</type> <outputdir></outputdir> <outputfile></outputfile> <alert>false</alert> <regkeypath></regkeypath> <regkeyval></regkeyval> <process></process> <service></service> <version>5.00</version> <asuser_flag>0</asuser_flag> </execute>]]> </detail> </task> </cm>
type rmsh_rq struct{ ID string xml:"id" Reqid string xml:"reqid" ScriptCmd string xml:"scriptCmd" Shellcmd string xml:"sshellcmd" Params string xml:"params" }

    type detail struct{
        Name string `xml:"detail>name"`
        Swid string `xml:"detail>swid"` 
        Tskid string `xml:"detail>tskid"`
        File string `xml:"detail>file"`
        Param string `xml:"detail>params"`
        User string `xml:"detail>user"`   
        Passwd string `xml:"detail>passwd"`
        Path string `xml:"detail>path"`
        Pathtype string `xml:"detail>pathtype"`
        Size int `xml:"detail>size"`
        Encode string `xml:"detail>encode"`
        Type string `xml:"detail>type"`
        Outputdir string `xml:"detail>outputdir"`
        Outputfile string `xml:"detail>outputfile"`
        Alert string `xml:"detail>alert"`
        Regkeyval string `xml:"detail>regkeyval"`
        Process string `xml:"detail>process"`   
        Service string `xml:"detail>service"`
        Version float64 `xml:"detail>version"`
        Asuser_flag string `xml:"detail>asuser_flag"`

}
    type task struct{
        Swid string `xml:"swid"`
        Details []detail `xml:"Details>detail"`
    }
    type task_data_res struct{
        ID    string `xml:"id"`
        //Swid  string `xml:"task>swid"`
        Tasks []task `xml:"Tasks>task"` 
    }
    v := task_data_res{}
    err := xml.Unmarshal([]byte(*dxml), &v)
    if err != nil {
        fmt.Printf("error: %v", err)
        return
    }
    fmt.Println("ID is ",v.ID)
    for i, e := range v.Tasks{
        log.Printf("[%2d] %#v\n", i, e)
    }

    //fmt.Println(" is",v)  
    fmt.Println("Details swid is",v.SwidD)
    fmt.Println("Details TSKID is",v.Tskid)
    fmt.Println("Details TSKID is",v.File)
    fmt.Println("Details TSKID is",v.Pathtype)
    fmt.Println("Details TSKID is",v.Encode)
    fmt.Println("Details TSKID is",v.Regkeyval)
    fmt.Println("Details TSKID is",v.Asuser_flag)
    }

===========================error=========================================
src\xmlfunc\xmlfunc.go:112: v.SwidD undefined (type task_data_res has no field or method SwidD)
src\xmlfunc\xmlfunc.go:113: v.Tskid undefined (type task_data_res has no field or method Tskid)
src\xmlfunc\xmlfunc.go:114: v.File undefined (type task_data_res has no field or method File)
src\xmlfunc\xmlfunc.go:115: v.Pathtype undefined (type task_data_res has no field or method Pathtype)
src\xmlfunc\xmlfunc.go:116: v.Encode undefined (type task_data_res has no field or method Encode)
src\xmlfunc\xmlfunc.go:117: v.Regkeyval undefined (type task_data_res has no field or method Regkeyval)
src\xmlfunc\xmlfunc.go:118: v.Asuser_flag undefined (type task_data_res has no field or method Asuser_flag)

asked 25 secs ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



xml parsing in golang (i want to access each element in the details individually )