samedi 31 janvier 2015

Ember Radio Button never be cleared after exiting the view


Vote count:

0




I have handelbar with 5 radio buttons as below:



  • {{view Ember.RadioButton id="option1" name="selectionTest" selectionBinding="isSelected" value=1}} {{i18n 'kwoption1'}}

  • {{view Ember.RadioButton id="option2" name="selectionTest" selectionBinding="controllerisSelected" value=2 valueBinding="radio1"}} {{i18n 'kwoption2'}}

  • {{view Ember.RadioButton id="option3" name="selectionTest" selectionBinding="isSelected" value=3}} {{i18n 'kwoption3'}}

  • {{view Ember.RadioButton id="option4" name="selectionTest" selectionBinding="isSelected" value=4}} {{i18n 'kwoption4'}}

  • {{view Ember.RadioButton id="option5" name="selectionTest" selectionBinding="isSelected" value=5}} {{i18n 'kwoption5'}}


  • when I click on submit button it will clear all radio buttons but after exiting the screen and try to access it again I am getting the old selected value. How can I clear the cache on this handlebar .


    Thanks in advance





asked 56 secs ago







Ember Radio Button never be cleared after exiting the view

how to put password screen lock to android phone programatically using my app


Vote count:

0




I used the below code to put password screen lock...but when the activity is called my app gets crash.. Do i need to add any permissions in android manifest?? How do i go about this..


public class LockDevice extends Activity{



public static DevicePolicyManager devicePolicyManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);

System.out.println("hello");

DevicePolicyManager devicePolicyManager =(DevicePolicyManager)getApplicationContext().getSystemService(Context.DEVICE_POLICY_SERVICE);
ComponentName demoDeviceAdmin =new ComponentName(this, LockDevice.class);

devicePolicyManager.setPasswordQuality(demoDeviceAdmin,DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED);
devicePolicyManager.setPasswordMinimumLength(demoDeviceAdmin, 5);

boolean result = devicePolicyManager.resetPassword("123456", DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);

Toast.makeText(this, "button_lock_password_device..."+result, Toast.LENGTH_LONG).show();
}


}



asked 35 secs ago







how to put password screen lock to android phone programatically using my app

how to detect if code is running on android or java se?


Vote count:

0




I have a library that will be run on either Android or Java SE. The library has different behaviour depending on the runtime, for example:



boolean runningOnJavaSE = isRunningOnJavaSE();
if (runningOnJavaSE)
{
doJavaSESetup();
}
else
{
doAndroidSetup();
}


How can this be done?


Many thanks.



asked 1 min ago







how to detect if code is running on android or java se?

Having problems with my website been viewed on apple devices


Vote count:

0




I hosted my website 3days ago, initially the first day i hosted the site my users where to view the site on their apple devices.


The next day i started having complains from my users saying there this error message displayed when the url is been entered in the browser(safari) on the apple devices


The error message reads: "safari could not open because the server cannot be found".


meanwhile others also reports to me that is coming on their devices especially people using Firefox or opera mini on either their desktop,laptop or phones.


what could be the problem? Is it a problem from my hosting provider



asked 18 secs ago







Having problems with my website been viewed on apple devices

VB.net EXE get appended data


Vote count:

0




I wan't to append and read data from an EXE File.


The Flow is like:



  1. My Main App appendes some data to an existing EXE File.

  2. The new EXE gets started by a User

  3. it reads the appended data and works with it

  4. Creates a file with the processed data.


Here I'm asking about Point 3! Im going to apend my data by opening the EXE in Binary mode and add 10times ASIC Code 0 to it followed by my data.


How can I read that data now? Ist a bit like a self extracting Archiv, but I haven't found a Resource about how they work.


Can I access the data directly or do I have to open it as a binary Stream again?



asked 18 secs ago







VB.net EXE get appended data

How do i prevent jenkins from single quoting the parameterized value


Vote count:

0




I have string parameter param1.If i try to build the job with param1=[a] and using $param1, jenkins adds single quote like 'param1=[a]'.How do i get rid of single quotes?



asked 1 min ago

ksbg

23






How do i prevent jenkins from single quoting the parameterized value

h1 not wrapping when the window is resized, just disappearing


Vote count:

0




So I've been trying desperately to get my page title to overlay in the center of the header image, both horizontally and vertically, on my portfolio pages (here's a page with a longer title http://ift.tt/1CmzcPr). I finally found a way to get the h1 title where I want it, but now I want to make it larger. However, when I currently resize the window to certain widths, the title doesn't wrap, it just disappears when it gets to long for the window. Would you mind taking a look and see if there would be a fix for this? I'm thinking that I'm using the wrong display tag somewhere along the line, but I'm not the best coder.


Here is the php for the header image and title (you can ignore the title that is black as I will get rid of that once I figure this one out). I think you should be able to see the rest of the html and css, but if I can provide anything else that may help with figuring this out, please let me know what that might be.



<?php get_header(); ?>

<div id="middle" class="clearfix">

<?php // Get the header image
$hi = getHeaderImage();
if($hi) :
?>
<div id="pageHeadImage" class="" >
<div class="inside" style="<?php echo 'background-image: url('.$hi.');' ?>">
<div id="projectTitleDiv">
<span class="aligner"></span>
<h1 class="projectTitle"><?php the_title(); ?></h1>
</div>
</div>
</div>
<?php endif;?>


asked 1 min ago







h1 not wrapping when the window is resized, just disappearing

iOS Completion Block Returning (null)


Vote count:

0




I am running a class method that has a completion block with an object that I want to return. However, when I get the value back, the properties are all there but the debugger says that object is (null) despite having a memory address when looking at more details. Does anyone know how this can be possible. Thanks!!


I have also attached an image to my debug area where the (null) is shown


http://ift.tt/1DsFHxd



+ (void)getBoard:(NSInteger)boardId withUser:(User *)user completion:(void (^)(Board *board))compBoard {
NSDictionary* headers = @{@"Accept": @"application/json", @"Authorization": [NSString stringWithFormat:@"Bearer %@", user._token]};
[[UNIRest get:^(UNISimpleRequest *request) {
[request setUrl:[NSString stringWithFormat:@"%@/boards/%zd", REST_URL, boardId]];
[request setHeaders:headers];
}] asJsonAsync:^(UNIHTTPJsonResponse *jsonResponse, NSError *error) {
NSDictionary* json = [NSJSONSerialization JSONObjectWithData:[jsonResponse rawBody] options:kNilOptions error:&error];
NSLog(@"Response status of boards: %ld\n%@", (long) jsonResponse.code, json);
if ( jsonResponse.code >= 200 && jsonResponse.code <= 300 ) {
NSDictionary *boardDict = [NSJSONSerialization JSONObjectWithData:[jsonResponse rawBody] options:kNilOptions error:&error];

Board *board = [[Board alloc] init];

board._courseId = [[boardDict objectForKey:@"courseId"] integerValue];
board._udid = [[boardDict objectForKey:@"boardId"] integerValue];
board._boardName = [boardDict objectForKey:@"name"];
NSDate *dateModified = [NSDate convertFromStringFromRemote:[boardDict objectForKey:@"lastModified"]];
board._dateModified = dateModified;
NSDate *dateCreated = [NSDate convertFromStringFromRemote:[boardDict objectForKey:@"createdDate"]];
board._dateCreated = dateCreated;

compBoard(board);
}
}];
}


asked 1 min ago







iOS Completion Block Returning (null)

PHP: Does "require 'file.php'" included from disc every time a user request it?


Vote count:

0




Does PHP cached content of required files or every time they read from disk? I know there is tools like APC but I want to know is PHP smart enough to do something like this?


If it's so then how PHP track changes or know when a file needs to be cached again?


Thanks



asked 1 min ago

SAMPro

322






PHP: Does "require 'file.php'" included from disc every time a user request it?

serializing session array and save it to database


Vote count:

0




This is my code for saving purchase order form to database..



function save(&$purchase_data,$purchase_id)
{
$success=false;

//Run these queries as a transaction, we want to make sure we do all or nothing
$this->db->trans_start();

if($purchase_data)
{
if (!$purchase_id or !$this->exists($purchase_id))
{
//$purchase_data['purchase_id'] = $purchase_id = $purchase_data['purchase_id'];
$success = $this->db->insert('purchase_order',$purchase_data);
$post_array['cart']=$this->session->userdata('data');
/*print_r($post_array);
exit;*/
$purchase_id=$this->db->insert_id();
$i=0;
foreach($post_array['cart'] as $item)
{
//echo "<pre>"; print_r($item); echo "</pre>";
$query = $this->db->query("SELECT name FROM phppos_items WHERE item_id='".$item['product_id']."'");
foreach ($query->result() as $row)
{
$product_name=$row->name;

}
$product_id=$item['product_id'];
$quantity=$item['quantity'];
$unit=$item['unit'];
$unit_rate=$item['unit_rate'];
$query = $this->db->query("insert into phppos_productdetails(product_id,product_name,quantity,unit,unit_rate,purchase_id) values ('$product_id','$product_name','$quantity','$unit','$unit_rate','$purchase_id')");

$i++;
}
}
}


Now this code insert multiple rows in productdetails table but I want to serialize this array and want to store whole array in one column. So how do I do it??



asked 59 secs ago







serializing session array and save it to database

Mongoid, Update parent and child at the same time


Vote count:

0




I have the following model structure: a Banner embeds_many Slides and each Slide embeds_many contents



class Banner
include Mongoid::Document

embeds_many :slides

accepts_nested_attributes_for :slides, allow_destroy: true
end

class Slide
include Mongoid::Document

embedded_in :banner
embeds_many :contents

accepts_nested_attributes_for :contents, allow_destroy: true
end

class Content
include Mongoid::Document

embedded_in :slide

field :value, type: String
end


and I am starting with a banner that has one slide with some contents. Now I send a JSON request to the server to add new contents to the existing slide and create new slide with its contents; something like



'banner' => {
'_id' => '123',
'slides_attributes' => [
{
'_id' => '1',
'contents_attributes' => [
{ '_id' => '1', 'value' => 'some persisted value' },
{ 'value' => 'new content here, there is no _id yet' }
]
},
{
'contents_attributes' => [
{ 'value' => 'new content in a newly created slide' }
]
}
]
}


Now calling banner.update banner_params give me some very strange error:



Moped::Errors::OperationFailure (The operation: #<Moped::Protocol::Command
@length=87
@request_id=594
@response_to=0
@op_code=2004
@flags=[]
@full_collection_name="web_builder_development.$cmd"
@skip=0
@limit=-1
@selector={:getlasterror=>1, :w=>1}
@fields=nil>

failed with error 16837: "Cannot update 'banner.slides.0.contents' and 'banner.slides' at the same time"


while this is a self-explanatory error:



failed with error 16837: "Cannot update 'banner.slides.0.contents' and 'banner.slides' at the same time"



but I am pretty sure that I am allowed to create new slides and add new contents to existing slides at once



asked 52 secs ago







Mongoid, Update parent and child at the same time

encrypting a batch file with a diffrent baatch file


Vote count:

0




I am currently designing a network of batch files however I have hit a dead end. I would like to encrypt one batch file using a different batch file.


or


encrypt more then one batch file with one unencrypted batch file. I have found many ways to do this however none of them work on a USB drive and I would like to store all my files on the drive.


if anyone has a solution, I would be in your debt forever.



asked 21 secs ago







encrypting a batch file with a diffrent baatch file

How to download a file from google-drive to android programatically


Vote count:

0




What i am trying to do:



  • I am trying to download a file(.txt) from GOOGLE-DRIVE to android folder(RAW-folder) in my project


. What i know:



  • I know how to write async task and to make http-request to server


. What i am trying to find:



  1. Is there any already answered stackoverflow question on this, i couldn't find it

  2. What are the procedure i need to follow to enable file sharing in google drive and to download the file into my folder



asked 1 min ago







How to download a file from google-drive to android programatically

Does all drawing in Android happen in a single thread?


Vote count:

0




I have custom checkbox PNGs. I didn't create disabled images; instead, the custom drawable, when drawing a disabled checkbox, sets a "graying-out" color filter to the state-list drawable and then draws it. That worked quite well until version 4.4.4. Unfortunately, in Android L, once a disabled checkbox is drawn, this color filter is applied to all checkboxes as soon as they are redrawn.


I am wondering whether drawing in Android L happens in multiple threads. That's the only explanation I can find for this "propagation" of the color filter to the other checkboxes...



asked 57 secs ago







Does all drawing in Android happen in a single thread?

JQUERY - Possible conflict, trying to use Tipue Search 4.0


Vote count:

0




I have tried everything to get this search up and running. No matter what I do, the search either does nothing, spinner endlessly spins and nothing loads or I get "ERROR LOADING PAGE." I feel like it may be a jquery conflict issue.


jquery.min.js is version 1.11.1 jquery mobile is 1.4.3


Hope you can help! ; )


Here is the index.html



<html>
<head>
<title>TEST</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

<!-- jQueryMobileCSS - styling-->
<link rel="stylesheet" href="css/jqeury.mobile.theme.min.css" />

<!-- jQueryMobile icons -->
<link rel="stylesheet" href="css/jquery.mobile.icons.min.css" />

<!-- jQueryMobile core CSS -->
<link rel="stylesheet" href="css/jquery.mobile.min.css" />

<!-- Load Google Fonts -->
<link href='http://ift.tt/1zncTak' rel='stylesheet' type='text/css'>

<!-- Load Font Awesome Icons -->
<link rel="stylesheet" href="css/font-awesome.min.css">

<!-- jQuery -->
<script src="js/jquery.min.js"></script>

<!-- jQueryMobile -->
<script src="js/jquery.mobile.min.js"></script>


<link rel="stylesheet" type="text/css" href="tipuesearch/tipuesearch.css">
</head>
<body>

<div data-role="page" data-theme='b'>

<div class="block">
<form action="search.html">
<input type="text" name="q" id="tipue_search_input" autocomplete="off">
</form>

</div>
</div>
</body>
</html>


This is the search.html (as it states to do in tipue docs)



<!DOCTYPE HTML>
<html>
<head>
<title>TEST</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

<!-- jQueryMobileCSS - styling-->
<link rel="stylesheet" href="css/jqeury.mobile.theme.min.css" />

<!-- jQueryMobile icons -->
<link rel="stylesheet" href="css/jquery.mobile.icons.min.css" />

<!-- jQueryMobile core CSS -->
<link rel="stylesheet" href="css/jquery.mobile.min.css" />



<!-- Load Google Fonts -->
<link href='http://ift.tt/1zncTak' rel='stylesheet' type='text/css'>

<!-- Load Font Awesome Icons -->
<link rel="stylesheet" href="css/font-awesome.min.css">

<!-- jQuery -->
<script src="js/jquery.min.js"></script>

<!-- jQueryMobile -->
<script src="js/jquery.mobile.min.js"></script>


<script type="text/javascript" src="tipuesearch/tipuesearch_set.js"></script>
<script type="text/javascript" src="tipuesearch/tipuesearch_content.js"></script>
<link rel="stylesheet" type="text/css" href="tipuesearch/tipuesearch.css">
<script type="text/javascript" src="tipuesearch/tipuesearch.js"></script>
</head>
<body>

<div data-role="page" data-theme='b'>

<div data-role="content">

<div class="block" ><form action="search.html">
<input type="text" name="q" id="tipue_search_input" autocomplete="off" required placeholder="Enter manufactuer or part number" >
</form>

</div> </div>

<div id="tipue_search_content"></div>


</div>


<script>
$(document).ready(function() {
$('#tipue_search_input').tipuesearch({
'show': 6
});
});
</script>


</body>
</html>


asked 1 min ago







JQUERY - Possible conflict, trying to use Tipue Search 4.0

How can I ignore the "end of line" or "new line" character when reading text files word by word?


Vote count:

0




Objective: I am reading a text file word by word, and am saving each word as an element in an array. I am then printing out this array, word by word. I know this could be done more efficiently, but this is for an assignment and I have to use an array.


/* I'm doing more with the array, such as counting repeated elements, removing certain elements, etc. I also have successfully converted the files to be entirely lowercase and without punctuation.*/


Current Situation: I have a text file that looks like this:




beginning of file


more lines with some bizzare spacing some lines next to each other while


others are farther apart eof




Here is some of my code with itemsInArray initialized at 0 and an array of words refered to as wordArray[ (approriate length for my file ) ]:





ifstream infile;
infile.open(fileExample);

while (!infile.eof()) {

string temp;
getline(infile,temp,' '); // Successfully reads words seperated by a single space


if ((temp != "") && (temp != '\n') && (temp != " ") && (temp != "\n") && (temp != "\0") {
wordArray[itemsInArray] = temp;
itemsInArray++;
}




The Problem:


My code is saving the end of line character as an item in my array. In my if statement, I've listed all of the ways I have tried to disclude the end of line character, but I've had no luck.


How can I prevent the end of line character from saving as an item in my array?


I've tried a few other methods I have found on threads similar to this, including something with a *const char that I couldn't make work, as well as iterating through and deleting the new line characters. I've been working on this for hours, I don't want to repost the same issue, and have tried many many methods. Please help me if you can.


This is all in C++.



asked 1 min ago







How can I ignore the "end of line" or "new line" character when reading text files word by word?

Reading a file into a an Array


Vote count:

0




Let's say I am coding a C++ program to read a text file "file.txt" containing data of double type. I'd like to perform some arithmetic operations on the data and hence my best venue is to store it into an array D such that dim(D) = 1.


The problem is that to declare D I must use a known constant to tell it how many lines it should have. What if I don't know how large the data in "file.txt" is? How do I declare the array then?


Thank you



asked 7 mins ago







Reading a file into a an Array

jQuery for each div class find child and insertAfter


Vote count:

0




Sorry I couldn't be more specific with the title. I am losing my mind over this xD Okay,so I am editing my blog theme and I need to move (cut and paste) specific div two divs under itself in specific blog post. I managed to make it work like this:



$(".blog_post.text_post .bottom_meta").insertAfter(".blog_post.text_post .moreinfo");


And on first sight it looks okay,but when I wrote another text post (usually posts are images) it makes a mess on my blog. The code now moves .bottom_meta from both posts under both .moreinfo .


I tried using each function but I failed multiple times...



$(".blog_post.text_post").each(function(){
$(this).children(".bottom_meta").insertAfter.$(this).children(".moreinfo");
});


I tried the same with 'find' function instad of 'children',still a fail.


Can anyone help me out with this or at least point me out to the right direction. Sorry for my bad English I hope you understand what am I trying to achieve.


Thanks, Mors.



asked 1 min ago







jQuery for each div class find child and insertAfter

How to open .jar from resources in Visual Basic


Vote count:

0




Hello I making launcher for my few servers, first I tried only open, but then I found a problem I need directory, so I uploud jar file to resources of project, and now idk how to open it, can you help me?


Before this I do this code:



Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
Dim ProcessProperties As New ProcessStartInfo
ProcessProperties.FileName = "C:\Users\Stuneris\Desktop\NewHistoryRemains.jar"
ProcessProperties.Arguments = "java -jar ""NewHistoryRemains.jar"""
ProcessProperties.WindowStyle = ProcessWindowStyle.Maximized
Process.Start(ProcessProperties)
Me.Close()
End Sub


So for this I need directory ProcessProperties.FileName = "C:\Users\Stuneris\Desktop\NewHistoryRemains.jar" Its bad, for making installer, so how to open it now if I uploaded it to resources. I upload that file to resources



asked 47 secs ago







How to open .jar from resources in Visual Basic

Android Send Bluetooth Message Receives Space Character


Vote count:

0




I am making communication between an 2013 Nexus 7 with Android 4.4.4 and an Arduino Mega 2560 with an HC-06 bluetooth unit. I have established a connection from the Nexus 7 to the HC-06 and have gotton data to the Nexus from the Arduino but I am unable to transfer data from the Nexus 7 to the Arduino. I get no errors when I transfer data in Android, but the Arduino receives a space instead of the character I sent.


Android write method:



public void write(String message) {
Log.d(TAG, "...Data to send: " + message + "...");
byte[] msgBuffer = message.getBytes();
try {
mmOutStream.write(msgBuffer);
} catch (IOException e) {
Log.e(TAG, "...Error data send: " + e.getMessage() + "...");
}
}


Sends data:



public static void sendInfo(String info) {
boolean isErr = false;
if (MainActivity.isConnected) {
Log.d(TAG, "In sentInfo()");
//Log.d(TAG, "...Data to send: " + info + "...");
//TO(done)DO: send info to bluetooth device (Arduino)
byte[] msg = info.getBytes();


try {
mConnectedThread.write(info);
} catch (NullPointerException n) {
isErr = true;
Log.e("Error", "Failed to send message \"" + Arrays.toString(msg) + "\" with error \"" + n.getMessage() + ".\"");
}

if (!isErr) {
Log.i("sentInfo", "In sentInfo(), this was sent: " + Arrays.toString(msg));
//noinspection ALL
isErr = false;
}
} else {
Toast.makeText(MainActivity.mThis, "Please connect the Arduino", Toast.LENGTH_SHORT).show();
}
}


Arduino receive code:



int setMsg() {
if (Serial1.available() > 0) {
chars = Serial1.available();
incomingByte = Serial1.read();
putstring("You've Got Mail! Characters: ");
Serial.print(chars);
putstring(" Message: '");
Serial.print(incomingByte);
putstring_nl("'.");
if (incomingByte == 49) {
return 1;
flashLED(500);
Serial.println(msg);
} else if (incomingByte == 50) {
return 2;
flashLED(500);
Serial.println(msg);
} else if (incomingByte == 51) {
return 3;
flashLED(500);
Serial.println(msg);
} else if (incomingByte == 52) {
return 4;
flashLED(500);
Serial.println(msg);
} else if (incomingByte == 53) {
return 5;
flashLED(500);
Serial.println(msg);
} else if (incomingByte == 100) {
return 6;
flashLED(500);
Serial.println(msg);
} else {
Serial.println(incomingByte);
digitalWrite(ledPin, HIGH);
delay(3250);
digitalWrite(ledPin, LOW);
delay(20);
}
}
}


Please explain why the Arduino's Serial always prints You've Got Mail! Characters: 1 Message: ' '. when the Nexus 7 sends any message (I only send numbers in quotes to the sendInfo() function) to the HC-06.



asked 1 min ago







Android Send Bluetooth Message Receives Space Character

MSSQL Service Broker queue event notification not raised


Vote count:

0




Environment: SQL Server 2012 Express edition.


Goal: Setup SQL Server Service Broker with External Activation, calling a command line app.


What I have done so far: created message types, contracts, initiator and receiver queues and corresponding services. I also did set up a notification queue, notification service and created event notification for the TargetQ. The event notification is configured so that when an event is raised, it should (I thnk) call the NotifySvc letting it know that there is work to be processed in TargetQ. Please feel free to correct me at any point – this is very new to me.


What happens: I have a trigger on a table that (upon insert) creates a message and calls the TargetSvc. The message arrives at the TargetQ happily. And this is where everything stops. I am not sure if the event notification for queue activation is never triggered or what, but the message never makes it to the NotifyQ. Therefore my EA app is never called. I realize I am skipping a lot of detail around setup and configuration but, as the topic is new to me, I am hoping that you guys see something obvious. Any help is much appreciated.



asked 1 min ago







MSSQL Service Broker queue event notification not raised

Trouble Installing Nokogiri mac OS X Yosemite v.10.10.1 because of libxml2 while upgrading to rails 4.2.0


Vote count:

0




I'm trying to install rails 4.2.0 on my computer, but I am having issues with installing nokogiri. I followed the steps in this question's first answer, but when I run brew install nokogiri, I get the following:



Activating libxslt 1.1.28 (from /Users/dseibert/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2/ports/x86_64-apple-darwin14.0.0/libxslt/1.1.28)...
checking for main() in -llzma... yes
checking for xmlParseDoc() in libxml/parser.h... no
checking for xmlParseDoc() in -lxml2... no
checking for xmlParseDoc() in -llibxml2... no
-----
libxml2 is missing. Please locate mkmf.log to investigate how it is failing.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/dseibert/.rvm/rubies/ruby-2.2.0/bin/$(RUBY_BASE_NAME)
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
--with-xml2lib
--without-xml2lib
--with-libxml2lib
--without-libxml2lib

extconf failed, exit code 1

Gem files will remain installed in /Users/dseibert/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /Users/dseibert/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0/nokogiri-1.6.6.2/gem_make.out


I cant find the mkmf file to locate the details of my libxml2 file, and I dont see either the lib xml2 file or the nokogiri folder within my ruby source folder.


And when I run brew install libxml2, I get Warning: libxml2-2.9.2 already installed


aside:


This is my first question, so let me know if there's something I can improve on for the next question I ask. For several years I have been able to find the answers to my questions without asking my own, but cant this time I can't.



asked 32 secs ago







Trouble Installing Nokogiri mac OS X Yosemite v.10.10.1 because of libxml2 while upgrading to rails 4.2.0

How to choose an object depending in three variables


Vote count:

0




Please, be patient with me otherwise i will be blocked. This is the problem to resolve; A woman needs to choose one of three man by his height and weight. This are the conditions to be the winner enter code here1. If his weight exceed 75kg get rejected enter code here2. Height should be closer to 180cm. enter code here3. If all of them exceed the 75kg, the winner is the one get closer to 255(sum of weight and height. For example; enter code here'179+77=256 this is the winner. enter code here'190+80=270 enter code here'160+90=250 enter code here4. And if all of them are the same, they will appear in enter code herealphabetical order.


**This is my code*



#include<conio.h>
#include<stdio.h>
typedef struct choose{
char name[20];
int height;
int weight;
}b;
int main(){
b man[3];
int i,in[3],e=0,suma[3];
for(i=0;i<3;i++){
printf("whats your name");
scanf("%s",man[i].name);
printf("whats your height");
scanf("%d",&man[i].height);
printf("whats your weight");
scanf("%d",&man[i].weight);
suma[i]=man[i].height+man[i].weight;
}
for(i=0;i<3;i++){
printf("%s,man[i].name");
printf("%d,man[i].height");
printf("%d,man[i].weight");
}
if (man[i].weight<=75){
in[e]==i;
e++;

}

getch();
return 0;
}


asked 27 secs ago







How to choose an object depending in three variables

Character encoding/decoding returns ? signs or weird results when form is submitted


Vote count:

0




I know there are many similar posts about this but so far I couldn't solve my problem although I went thru them. I'm trying to print exact search keywords when I hit Search button but unfortunately I'm seeing encoded versions and I cannot decode. I read up on utf8_decode and iconv but no luck so far. I have many languages being used in my site but I'm only struggling with the chars below.


Note: I'm using utf8mb4_unicode_ci as collation in MySQL and same keywords were inserted into table as Ç, &#286;, &#304;, Ö, &#350;, Ü, ç, &#287;, &#305;, ö, &#351;, ü so because of encoding differences, search will fail in most case.


SEARCH KEYWORD: Ç, Ğ, İ, Ö, Ş, Ü, ç, ğ, ı, ö, ş, ü


SITE



<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form method="post" action="search.php">
Keyword: <input type="text" name="keywords" />
<button type="submit" class="btn btn-default">Search</button>
</form>
</body>
</html>


search.php



echo $_POST['keywords'];
echo '<br />';
echo utf8_decode($_POST['keywords']);
echo '<br />';
echo iconv("ISO-8859-1", "UTF-8", $_POST['keywords']);


CURRENT OUTPUT



Ç, Ğ, İ, Ö, Ş, Ü, ç, ğ, ı, ö, ş, ü
Ç, ?, ?, Ö, ?, Ü, ç, ?, ?, ö, ?, ü
Ç, Ğ, İ, Ö, Ş, Ü, ç, ğ, ı, ö, ş, ü


asked 2 mins ago

inanzzz

1,465






Character encoding/decoding returns ? signs or weird results when form is submitted

Connect two networks with OpenVPN


Vote count:

0




I am trying to connect two networks together via OpenVPN.


Gateways can ping each other, however they cannot access other computers on the network they're joining. Logs don't show any errors, and the connection is established.


What am I missing here? Seems like many are having this issue for various reasons, but after 50+ tries I gave up and decided to ask :)


Network 1:


dev tun port 1194 ifconfig 10.8.222.40 10.8.222.41 route 10.2.1.0 255.255.255.0 vpn_gateway comp-lzo keepalive 10 60 persist-key persist-tun user nobody group nobody secret /etc/openvpn/static.key


ip route default via 10.0.1.1 dev eth0 10.0.1.0/27 dev eth0 proto kernel scope link src 10.0.1.9 10.2.1.0/24 via 10.8.222.41 dev tun0 10.3.0.0/24 via 10.3.0.2 dev tun2 10.3.0.2 dev tun2 proto kernel scope link src 10.3.0.1 10.8.222.41 dev tun0 proto kernel scope link src 10.8.222.40 172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.42.1


Network 2


dev tun port 1194 remote my_ext_ip 1194 ifconfig 10.8.222.41 10.8.222.40 route 10.0.0.0 255.254.0.0 vpn_gateway comp-lzo keepalive 10 60 persist-key persist-tun user nobody group nobody secret /etc/openvpn/static.key


ip route default via 10.2.1.1 dev eth0 10.0.0.0/15 via 10.8.222.40 dev tun0 10.2.1.0/24 dev eth0 proto kernel scope link src 10.2.1.9 10.8.222.40 dev tun0 proto kernel scope link src 10.8.222.41 172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.42.1 172.27.224.0/22 dev as0t0 proto kernel scope link src 172.27.224.1 172.27.228.0/22 dev as0t1 proto kernel scope link src 172.27.228.1 172.27.232.0/22 dev as0t2 proto kernel scope link src 172.27.232.1 172.27.236.0/22 dev as0t3 proto kernel scope link src 172.27.236.1



asked 1 min ago







Connect two networks with OpenVPN

MySQL Query: From SELECT to UPDATE


Vote count:

0




I've built out this SELECT query and it returns the correct results:



SELECT CONCAT_WS(' ', n.contact_first_name, n.contact_last_name), n.contact_id, s.contact_id
FROM contact n
JOIN demographics s ON s.contact_id = n.contact_id


I get a table with the two names concatenated and the matching contact_id. My purpose with this is to write all the contact_first_name and contact_last_name into the demographics table under the column name demographics_name. However, I've tried to 'convert' my SELECT statement into an UPDATE and I ran into a duplicate column name issue. Here's the query I've tried to build:



UPDATE demographics d
INNER JOIN (SELECT n.contact_first_name, n.contact_last_name, n.contact_id, s.contact_id
FROM contact n
JOIN demographics s ON s.contact_id = n.contact_id
) c
ON c.contact_id = d.contact_id
SET d.demographics_name = CONCAT_WS(' ', c.contact_first_name, c.contact_last_name)


I can't spot the mistake I've made and I could really use the help of a fresh set of critical eyes to point out what I'm missing here.



asked 20 secs ago







MySQL Query: From SELECT to UPDATE

Updating Red5 SharedObject closing stream


Vote count:

0




I'm trying to create a voice conference room with all users can speak and use the mic. But as an Admin, I should have the privilege to mute any user. So, I add to the user an attribute for the mic which will be check in client side and enable/disable user's mic accordingly. The server side code looks like:



String identifier;
String userID;
private int _gId = 1;
private Map<String,Object> newUser;
@Override
public boolean appConnect(IConnection conn, Object[] params) {

identifier = (String)params[1];
userID = (String)params[0];
int _globalUserId = _gId++;

conn.getClient().setAttribute("id", _globalUserId);

newUser = new HashMap<String,Object>();
newUser.put("identifier", (String)params[0]);
newUser.put("mic", 1); //mic value to be checked in client side
return true;
}

@Override
public boolean roomJoin(IClient client, IScope scope) {
ISharedObject so = getSharedObject(scope, "users_so");
so.setAttribute(userID,newUser);

return true;
}

@SuppressWarnings("unchecked")
public void muteUser(String userID){
IScope scope = Red5.getConnectionLocal().getScope();
ISharedObject so = getSharedObject(scope, "users_so");
Map<String,Object> user= new HashMap<String,Object>();
user = (Map<String, Object>) so.getAttribute(userID);
if(user != null){
user.put("mic", 0);
so.beginUpdate();
boolean removed = so.removeAttribute(userID);
boolean updated = so.setAttribute(userID,user);
so.endUpdate();
log.info("Mic: " + user.get("mic"));
log.info("Removed: " + removed);
log.info("Updated: " + updated);
}

}


The problem rises when I try to call the muteUser method. Red5 says that the stream is closed. I think this happens when I remove the attribute of the user and added it again but I couldn't find another way to update the sharedObject's mic value.


Does any one have a better idea to update a sharedObject without loosing stream??


Thank you



asked 41 secs ago







Updating Red5 SharedObject closing stream

Bind css class to the current uiRouter state


Vote count:

0




I know about existing ui-sref-active directive, but in my case i'm changing state internally using $state.go(""), so this directive won't work for my. I've also tried to write it as ng-class="{active: vm.isOpened()}", but it throws TypeError: boolean is not a function. Any other ways to do this?



asked 1 min ago

4lex1v

10.2k






Bind css class to the current uiRouter state

linux - access /proc/self/auxv from setuid program


Vote count:

0




I have a program that reads /proc/self/auxv in order to get the value of AT_EXECFN. I cannot use getauxval because I have to support systems with a glibc older than 2.16.


The program in this case is setuid/setgid. What I am finding is that linux uses different permissions in /proc/self for setuid/setgid binaries. In particular, auxv is root:root with permissions of 400 (readable by user only). I have not been able to find much documentation on this, but that is the behavior I am seeing.


So the question : is it possible to get at the auxiliary vector in a setuid/setgid program?



asked 33 secs ago







linux - access /proc/self/auxv from setuid program

How to get thread title using praw?


Vote count:

0




I'm using praw to write a bot for reddit. I already know how to use the get_comments() function to get all the comments in a subreddit. However, I would like to get the titles of all the posts in a subreddit, however, after going through the docs for praw, I could not find a function which does so.


I just want to go into a subreddit, and fetch all the titles of the posts, and then store them in an object.


Could someone tell me how I go around achieving this?



asked 1 min ago







How to get thread title using praw?

Spring MVC Hibernate Error


Vote count:

0




I am new in spring mvc with hibernate, I wrote a simple application with Spring MVC 4.1.4 and Hibernate 4.3.8. But an error occurs when run-time :



WARNING: Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.view.ContentNegotiatingViewResolver#0' defined in ServletContext resource [/WEB-INF/config/servlet-config.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonGenerator
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:663)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:629)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:677)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:548)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:489)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1241)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1154)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonGenerator
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethods(Unknown Source)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:571)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:490)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:474)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:241)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1057)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1030)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:299)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:382)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:157)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1469)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
... 35 more
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.JsonGenerator
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1295)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1147)
... 53 more


My Maven pom.xml file is as below :



<project xmlns="http://ift.tt/IH78KX" xmlns:xsi="http://ift.tt/ra1lAU"
xsi:schemaLocation="http://ift.tt/IH78KX http://ift.tt/HBk9RF">
<modelVersion>4.0.0</modelVersion>
<groupId>com.pluralsight</groupId>
<artifactId>FitnessTracker</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>FitnessTracker Maven Webapp</name>
<url>http://ift.tt/19pvvEY;
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.1.4.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>4.1.4.RELEASE</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.21</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.8.Final</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.1.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.1.4.RELEASE</version>
</dependency>
</dependencies>
<build>
<finalName>FitnessTracker</finalName>
</build>
</project>


The jpaConfig.xml is as below :



<beans xmlns="http://ift.tt/GArMu6"
xmlns:xsi="http://ift.tt/ra1lAU"
xmlns:tx="http://ift.tt/OGfeU2"
xmlns:context="http://ift.tt/GArMu7"
xsi:schemaLocation="http://ift.tt/GArMu6 http://ift.tt/1CZCNBy
http://ift.tt/GArMu7 http://ift.tt/1tY3uA9
http://ift.tt/OGfeU2 http://ift.tt/UJ63uf">

<context:annotation-config />
<context:component-scan base-package="com.pluralsight" />

<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

<bean name="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="punit"></property>
<property name="dataSource" ref="dataSource"></property>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true" />
</bean>
</property>
<property name="jpaPropertyMap">
<map>
<entry key="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
<entry key="hibernate.hbm2ddl.auto" value="create" />
<entry key="hibernate.format_sql" value="true" />
</map>
</property>
</bean>

<bean
id="transactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>


<tx:annotation-driven transaction-manager="transactionManager" />

<bean
id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/fitnessTracker?autoReconnect=true" />
<property name="username" value="root" />
<property name="password" value="123456" />
</bean>

</beans>


also the servlet-config.xml is configured as below :



<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://ift.tt/GArMu6"
xmlns:xsi="http://ift.tt/ra1lAU"
xmlns:context="http://ift.tt/GArMu7"
xmlns:mvc="http://ift.tt/1bHqwjR"
xmlns:p="http://ift.tt/1jdM0fE"
xsi:schemaLocation="http://ift.tt/1bHqwjR http://ift.tt/YzZ6hD
http://ift.tt/GArMu6 http://ift.tt/1jdM0fG
http://ift.tt/GArMu7 http://ift.tt/1tY3uA9">

<mvc:annotation-driven/>

<mvc:resources location="assets" mapping="/assets/**"/>
<mvc:resources location="pdfs" mapping="/pdfs/**"/>

<context:annotation-config />
<context:component-scan base-package="com.pluralsight"/>

<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="order" value="1" />
<property name="contentNegotiationManager">
<bean class="org.springframework.web.accept.ContentNegotiationManager">
<constructor-arg>
<bean class="org.springframework.web.accept.PathExtensionContentNegotiationStrategy">
<constructor-arg>
<map>
<entry key="json" value="application/json" />
<entry key="xml" value="application/xml" />
</map>
</constructor-arg>
</bean>
</constructor-arg>
</bean>
</property>

<property name="defaultViews">
<list>
<bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView" />
<bean class="org.springframework.web.servlet.view.xml.MarshallingView">
<constructor-arg>
<bean class="org.springframework.oxm.xstream.XStreamMarshaller">
<property name="autodetectAnnotations" value="true" />
</bean>
</constructor-arg>
</bean>
</list>
</property>
</bean>

<mvc:interceptors>
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" p:paramName="language"/>
</mvc:interceptors>

<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver" p:defaultLocale="en"/>

<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource"
p:basename="messages"></bean>

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" p:order="2"/>

<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" p:order="0"/>

</beans>


could you help for this problematic error?


Best Regards



asked 36 secs ago







Spring MVC Hibernate Error

How to find if a point coords is inside rhombus coords


Vote count:

0




MY RHOMBUS IMAGE



A = 282, 34 (x,y)
B = 59, 198 (x,y)
C = 282, 359 (x,y)
D = 509, 198 (x,y)

E = 10, 10


So I have this image and I am trying to search if coords of point E are inside my rhombus, I am trying to figure out what is the formula, I did some searches but nothing that works for me.



asked 1 min ago







How to find if a point coords is inside rhombus coords

Unable to Center Image Overlay in Wordpress


Vote count:

0




I am trying to center a shortcode of a map. Only this map has hotspots over it. If I use some defining code like:



<div style="width:80%;margin:0 auto;">[hotspot id=789 /]
</div>


...it will center the map, only it messes with the responsive theme and the map ends up being too large on a mobile device.


If I try a code to cause it to be able to respond to the responsiveness:



<div style="display: block; text-align: center; margin: 0 auto; width: 100%;">[hotspot id=107 /]</div>


...the map can adjust and the both map and overlay look great on a mobile device, but on a website, the overlay (pins) seems to be left justified. Sigh...


3 E Garrison


I can't seem to isolate the code that would affect the overlay. Any ideas?


Samantha



asked 1 min ago







Unable to Center Image Overlay in Wordpress

Android alert dialog layout


Vote count:

0




I have a little problem with alert dialog layout. This alert dialog have only one button.


Now it looks like this:

http://ift.tt/1tM9i4D


But I whant to look it like this: http://ift.tt/1wOnRj3


Sorry for links, I don't have enough reputation to upload images.


Ideas how to do it? And how to remove this white ugly stripe on it?



asked 34 secs ago







Android alert dialog layout

Unity C# If and Else both executing


Vote count:

0




So I'm having an issue where the if executes and then the else is executing as well the code looks like this below



if (PlayerManagement.players[i] == null){
print ("no");
}else{
print ("yes");


My console is printing both yes and no for the same object. Apparently it is both null and not null at the same time. How is this possible?



asked 1 min ago







Unity C# If and Else both executing

select pandas rows by excluding index number


Vote count:

0




Not quite sure why I can't figure this out. I'm looking to slice a Pandas dataframe by using index numbers. I have a list/core index with the index numbers that i do NOT need, shown below



pandas.core.index.Int64Index

Int64Index([2340, 4840, 3163, 1597, 491 , 5010, 911 , 3085, 5486, 5475, 1417, 2663, 4204, 156 , 5058, 1990, 3200, 1218, 3280, 793 , 824 , 3625, 1726, 1971, 2845, 4668, 2973, 3039, 376 , 4394, 3749, 1610, 3892, 2527, 324 , 5245, 696 , 1239, 4601, 3219, 5138, 4832, 4762, 1256, 4437, 2475, 3732, 4063, 1193], dtype=int64)


How can I create a new dataframe excluding these index numbers. I tried



df.iloc[combined_index]


and obviously this just shows the rows with those index number (the opposite of what I want). any help will be greatly appreciated



asked 14 secs ago







select pandas rows by excluding index number

How to make a Google Script fill in the closest row of cells to the top with a value and then stop without repeating


Vote count:

0




I am trying to create a function (using Google Scripts) that fills in the row of blank cells closest to the top in Google Spreadsheets with a certain value. The problem is that I don't want it repeating itself when it is done or overwriting existing data. I figured I could use some while and for loops to make this work, but so far I have had little success. Here is my existing code:



function add() {
var done = false
while(done === false) {
for(var i = 2; i <= SpreadsheetApp.getActive().getSheetByName("Sheet3").getMaxRows(); i++)
while((SpreadsheetApp.getActive().getSheetByName("Sheet3").getRange(i, 1).isBlank()) === true && (SpreadsheetApp.getActive().getSheetByName("Sheet3").getRange(i - 1, 1).isBlank()) === true) {
SpreadsheetApp.getActive().getSheetByName("Sheet3").getRange(i, 1).setValue("'... Complicated'")
SpreadsheetApp.getActive().getSheetByName("Sheet3").getRange(i, 2).setValue(Session.getActiveUser())
SpreadsheetApp.getActive().getSheetByName("Sheet3").getRange(i, 3).setValue(Session.getActiveUser().getEmail())
done = true;
}

}
}


I was thinking that after the text had been filled in to the closest blank cell to the top, the while loop outside the for loop should make the formula stop, because of the done = true script that I put at the bottom of the second while loop, but it didn't work. Any ideas?



asked 14 secs ago







How to make a Google Script fill in the closest row of cells to the top with a value and then stop without repeating

Android Studio transition and using sub libraries / sharing libraries


Vote count:

0




I am trying to transition all our projects from Eclipse to Android Studio (Finally decided i had to do it..!) but i am fighting seriously with the way how Android Studio / gradle works - in regard to using external library projects.


Until now in Eclipse - we used to have all the dependent projects in the same workspace and they where 'shared' amongst all projects which were under development.


That made it extremely nice to do changes on the external changes and commit them separately to their own SVN repos - while the projects using them - to take advantage of the changes without thinking.


That goes specifically to one library - our own framework which we use for all android projects and it is constantly being developed, altered, partially reworked and used by several people.


But then came Android Studio... the problem is that say if i have an example project with 10 sublibrary dependencies, including our framework - Android Studio with physically COPY all files into a subfolder of the main root project - loosing all the capabilities to 'commit' changes later being done to the sub libraries - to their own SVN repos.


I've tried pretty much everything, i think i've read everything :) but crap - nothing seems to 'fix' my work case..


I tried to checkout one sublibrary in the already checked out root folder of the root project and tried to import it into it - but ofcourse Android Studio says 'library already exists' - so that doesn't work. Even if it did... the library itself has its own deps and what i saw is that Android Studio will decouple them upon import and put them at the same level in the root project.. which completely messes everything up.


So my question is - even if i understand this is no longer possible - is there any EASY way i can at least COMMIT BACK to the SVN repo of the sublibrary from within the root owning project - using Android Studio (by easy i mean from the UI directly without needing to mess with manual console merge hazzle...)


I can't understand how anyone has not solved this yet - i am sure everyone is doing this one way or another?


Could someone share a good practice way of 'doing' it? :)


THANK YOU!



asked 22 secs ago







Android Studio transition and using sub libraries / sharing libraries

Cannot find symbol using DriverManager.getConnection()


Vote count:

0




I have this code below, where I use DriveManager to manage my database driver.



public static void main(String[] args)throws SQLException {
Connection con = new DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/first-example","SA","");
}


But Im having an error with .getConnection(), the error is:


Cannot find symbol


symbol: class getConnection


class: DriveManager



asked 34 secs ago

Marby

142






Cannot find symbol using DriverManager.getConnection()

Solr Stats Facet "invalid number"


Vote count:

0




Hi and Thanks in advance. Actually i'm using solr 4.10 and having an issue with stats facet behaviour i'm trying to perform a query where stats.field=X&Stats.facet=Y Both fields X and Y are defined as TrieIntField fields, Field X is Mutlivalue and Field Y is singleValue. I get this Error


error":{"msg":"Invalid Number: `\b$\n)S","code":400}}, i'm sure all values are Int , no strings ! Any ideas ?



asked 1 min ago







Solr Stats Facet "invalid number"

Android push notification - determine whether Notification.bigContentView is displayed


Vote count:

0




I'm creating a bigContentView notification layout as seen in this blog post. For tracking purposes it is important for me to know whether the bigContentView layout was displayed or not? Is there a programmatic way to know that? It could be before I display the notification or after.



asked 2 mins ago

Orr

1,205






Android push notification - determine whether Notification.bigContentView is displayed

How to set drools return message to a variable in mule esb?


Vote count:

0




this is my rules.drl :



global org.mule.module.bpm.MessageService mule;
import com.hamgam.hit.esb.*;
import org.mule.MessageExchangePattern

rule "La Vita Ebela"
dialect "mvel"

when
$x:XMLDTO( inputXML == "inputXML" )
then
mule.generateMessage("emc", "emc", null, MessageExchangePattern.ONE_WAY);
end


currently it is adding the message to a Queue named "emc", but i need to set it into a variable like :



<set-variable variableName="emc" value=""/>


i dont know how to set a variable as an endpoint. can any one give me hint?



asked 23 secs ago

dave

1,220






How to set drools return message to a variable in mule esb?

Django how to add value from model into another application's view?


Vote count:

0




I have 2 applications in my "aplikacja" django project:


From articles model I would like to get a value "title" from the first article and then put it into qr.views (it prepares for me a pdf file)


Articles models:



from django.db import models

class Article(models.Model):
title = models.CharField(max_length=150)
content = models.TextField(verbose_name="Zawartosc")
published = models.DateTimeField(verbose_name="Data Publikacji")


How to get a "title" value into qr views? I suppose I need to import article from aplikacja.articles.models. But how to get exactly value in test_qr method?



from reportlab.pdfgen import canvas
from django.http import HttpResponse
from reportlab.graphics.shapes import Drawing
from reportlab.graphics.barcode.qr import QrCodeWidget
from reportlab.graphics import renderPDF
from django.contrib.auth.models import User
from aplikacja.articles.models import article


def test_qr(request):
# Create the HttpResponse object with the appropriate PDF headers.
response = HttpResponse(content_type='application/pdf')
response['Content-Disposition'] = 'attachment; filename="somefilename.pdf"'

a= map(lambda x: str(x), User.objects.values_list('id', flat=True).order_by('id'))

p = canvas.Canvas(response)
p.drawString(10, 800, a[1])

qrw = QrCodeWidget(a[1])
b = qrw.getBounds()

w=b[2]-b[0]
h=b[3]-b[1]

d = Drawing(200,200,transform=[200./w,0,0,200./h,0,0])
d.add(qrw)

renderPDF.draw(d, p, 1, 1)

p.showPage()
p.save()
return response


asked 53 secs ago







Django how to add value from model into another application's view?

RazorGenerator.MSBuild doesn't generate pre-compiled razor views


Vote count:

0




I use RazorGenerator for my project. When I build and deploy directly throug powershell command everything works fine.


Then I tried to build and deploy using Bamboo tasks. But in the build output does not contains CodeGen folder with pre-compiled views.


The command in powershell and Bamboo task are the same:


.\MSBuild.exe C:\WebApi.csproj /p:Configuration=Dev /p:DeployOnBuild=True/p:PublishProfile="Dev" /p:ProfileTransformWebConfigEnabled=False /p:Username=username /p:Password=password /p:AllowUntrustedCertificate=true /p:VisualStudioVersion=12.0


Anybody have idea about that?


p.s. I used MsBuild v.12



asked 25 secs ago







RazorGenerator.MSBuild doesn't generate pre-compiled razor views