Java compiler error "type parameter
xxx.ecom.process.profile.offers.OfferEnriched is not within its bound"
I have 2 related questions:
Codefor question 1:
1 private List<OfferEnriched> sortedByDate(List<OfferEnriched> offers) {
2 Collections.sort(offers, new Comparator<OfferEnriched>() {
3 @Override
4 public int compare(OfferEnriched offer1, OfferEnriched offer2) {
5 return offer1.getExDate().compareTo(offer2.getExDate());
6 }
7 });
8 return offers;
9 }
Question 1: The error "type parameter
xxx.ecom.process.profile.offers.OfferEnriched is not within its bound" is
pointed at line 1 and 2 above. What is the problem?
Quetiosn 2: Also at the call of the method I get error: "cannot access
xxx.ecom.process.profile.offers.Offer. class file for
xxx.ecom.process.profile.offers.Offer not found". Why does the compiler
look for Offer in xxx.ecom.process.profile.offers package? See code below.
Code for question 2:
List<OfferEnriched> offers =
sortedByDate(getOffersHelper().enrichAllOffers(userContext,
getOffersAdapter().getOffers(market, emailAddr),
channelsWeCareAbout));
Error is pointed at above statement. OffersHelper class is in package
xxx.ecom.process.profile.helper and its enrichAllOffers method has
following signature:
public List<OfferEnriched> enrichAllOffers(UserContext userContext,
List<Offer> offers,
Collection<ChannelType> channelsWeCareAbout)
where Offer is in package xxx.profile.common.offers
Any help will be appreciated. Raj
Butera
Sunday, 1 September 2013
how to implement AsyncTask in Fragment
how to implement AsyncTask in Fragment
I've a activity which output data from json as a list. But now I want to
implement it in a fragment as I planned to put them into a tab.
This is my Activity file:
public class ListsActivity extends Activity {
private static final String SALES_ID = "sid";
private static final String CAT_ID = "cat_id";
TextView capitalTextView;
ProgressDialog progressDialog;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main2);
this.retrieveCapitals();
}
void retrieveCapitals() {
progressDialog = ProgressDialog.show(this,
"Please wait...", "Retrieving data...", true, true);
CapitalsRetrieverAsyncTask task = new CapitalsRetrieverAsyncTask();
task.execute();
progressDialog.setOnCancelListener(new CancelListener(task));
}
private class CapitalsRetrieverAsyncTask extends AsyncTask<Void, Void,
Void> {
Res res;
@Override
protected Void doInBackground(Void... params) {
File file = new File( "/json_example.txt");
if(file.exists()) {
try{
Reader inputStreamReader = new
InputStreamReader(new FileInputStream(file));
Gson gson = new Gson();
this.response = gson.fromJson(inputStreamReader,
Res.class);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (@SuppressWarnings("hiding") IOException e){
e.printStackTrace();
}
}
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
List<HashMap<String,String>> aList = new
ArrayList<HashMap<String,String>>();
for(Sales sales : this.response.sales){
HashMap<String, String> hm = new HashMap<String,String>();
//doing something
}
}
aList.add(hm);
}
}
// Keys used in HashMap
// Ids of views in listview_layout
// Instantiating an adapter to store each items
// R.layout.listview_layout defines the layout of each item
SimpleAdapter adapter = new SimpleAdapter(getBaseContext(),
aList, R.layout.listview_layout, from, to);
// Getting a reference to listview of main.xml layout file
ListView myList = ( ListView ) findViewById(R.id.listview);
// Setting the adapter to the listView
myList.setAdapter(adapter);
myList.setClickable(true);
// Item Click Listener for the listview
OnItemClickListener itemClickListener = new
OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View
container, int position, long id) {
Toast.makeText(getBaseContext(), ((TextView)
container).getText(), Toast.LENGTH_SHORT).show();
}
};
//myList.setTextFilterEnabled(true);
myList.setOnItemClickListener(itemClickListener);
progressDialog.cancel();
}
}
private class CancelListener implements OnCancelListener {
AsyncTask<?, ?, ?> cancellableTask;
public CancelListener(AsyncTask<?, ?, ?> task) {
cancellableTask = task;
}
@Override
public void onCancel(DialogInterface dialog) {
cancellableTask.cancel(true);
}
}
}
I want to put it into a following fragment file:
public class GridFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View gv = inflater.inflate(R.layout.hot_sales, null);
GridView gridView = (GridView) gv.findViewById(R.id.grid_view);
gridView.setAdapter(new ImageAdapter(this.getActivity()));
return gv;
//return super.onCreateView(inflater, container, savedInstanceState);
}
public class ImageAdapter extends BaseAdapter {
private Context mContext;
// Keep all Images in array
public Integer[] mThumbIds = {
R.drawable.sample_0,
R.drawable.sample_1, R.drawable.sample_2,
R.drawable.sample_3, R.drawable.sample_4,
R.drawable.sample_5, R.drawable.sample_6,
R.drawable.sample_7, R.drawable.sample_8,
R.drawable.sample_9, R.drawable.sample_10,
R.drawable.sample_11, R.drawable.sample_12,
R.drawable.sample_13, R.drawable.sample_14,
R.drawable.sample_15
};
// Constructor
public ImageAdapter(Context c){
mContext = c;
}
@Override
public int getCount() {
return mThumbIds.length;
}
@Override
public Object getItem(int position) {
return mThumbIds[position];
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(final int position, View convertView,
ViewGroup parent) {
ImageView imageView;
if (convertView == null) { // if it's not recycled,
initialize some attributes
imageView = new ImageView(mContext);
imageView.setImageResource(mThumbIds[position]);
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setLayoutParams(new GridView.LayoutParams(300, 200));
imageView.setPadding(10, 10, 10, 10);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//Log.d("onClick","position ["+ position +"]");
//Toast.makeText(HotSalesFragment.this, "" + position,
Toast.LENGTH_SHORT).show();
}
});
} else {
imageView = (ImageView) convertView;
}
imageView.setImageResource(mThumbIds[position]);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//Log.d("onClick","position ["+position+"]");
if(position == 0){
Intent gk = new
Intent(getActivity().getApplicationContext(),
ShopsListsActivity.class);
startActivity(gk);
}
}
});
return imageView;
}
}
}
Note: In this fragment I want to view it as gridview. And both files works
fine. but when I tried to implement AsyncTask I gets several redflags as
unreachable code. Can some help me with this please?
I've a activity which output data from json as a list. But now I want to
implement it in a fragment as I planned to put them into a tab.
This is my Activity file:
public class ListsActivity extends Activity {
private static final String SALES_ID = "sid";
private static final String CAT_ID = "cat_id";
TextView capitalTextView;
ProgressDialog progressDialog;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main2);
this.retrieveCapitals();
}
void retrieveCapitals() {
progressDialog = ProgressDialog.show(this,
"Please wait...", "Retrieving data...", true, true);
CapitalsRetrieverAsyncTask task = new CapitalsRetrieverAsyncTask();
task.execute();
progressDialog.setOnCancelListener(new CancelListener(task));
}
private class CapitalsRetrieverAsyncTask extends AsyncTask<Void, Void,
Void> {
Res res;
@Override
protected Void doInBackground(Void... params) {
File file = new File( "/json_example.txt");
if(file.exists()) {
try{
Reader inputStreamReader = new
InputStreamReader(new FileInputStream(file));
Gson gson = new Gson();
this.response = gson.fromJson(inputStreamReader,
Res.class);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (@SuppressWarnings("hiding") IOException e){
e.printStackTrace();
}
}
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
List<HashMap<String,String>> aList = new
ArrayList<HashMap<String,String>>();
for(Sales sales : this.response.sales){
HashMap<String, String> hm = new HashMap<String,String>();
//doing something
}
}
aList.add(hm);
}
}
// Keys used in HashMap
// Ids of views in listview_layout
// Instantiating an adapter to store each items
// R.layout.listview_layout defines the layout of each item
SimpleAdapter adapter = new SimpleAdapter(getBaseContext(),
aList, R.layout.listview_layout, from, to);
// Getting a reference to listview of main.xml layout file
ListView myList = ( ListView ) findViewById(R.id.listview);
// Setting the adapter to the listView
myList.setAdapter(adapter);
myList.setClickable(true);
// Item Click Listener for the listview
OnItemClickListener itemClickListener = new
OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View
container, int position, long id) {
Toast.makeText(getBaseContext(), ((TextView)
container).getText(), Toast.LENGTH_SHORT).show();
}
};
//myList.setTextFilterEnabled(true);
myList.setOnItemClickListener(itemClickListener);
progressDialog.cancel();
}
}
private class CancelListener implements OnCancelListener {
AsyncTask<?, ?, ?> cancellableTask;
public CancelListener(AsyncTask<?, ?, ?> task) {
cancellableTask = task;
}
@Override
public void onCancel(DialogInterface dialog) {
cancellableTask.cancel(true);
}
}
}
I want to put it into a following fragment file:
public class GridFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View gv = inflater.inflate(R.layout.hot_sales, null);
GridView gridView = (GridView) gv.findViewById(R.id.grid_view);
gridView.setAdapter(new ImageAdapter(this.getActivity()));
return gv;
//return super.onCreateView(inflater, container, savedInstanceState);
}
public class ImageAdapter extends BaseAdapter {
private Context mContext;
// Keep all Images in array
public Integer[] mThumbIds = {
R.drawable.sample_0,
R.drawable.sample_1, R.drawable.sample_2,
R.drawable.sample_3, R.drawable.sample_4,
R.drawable.sample_5, R.drawable.sample_6,
R.drawable.sample_7, R.drawable.sample_8,
R.drawable.sample_9, R.drawable.sample_10,
R.drawable.sample_11, R.drawable.sample_12,
R.drawable.sample_13, R.drawable.sample_14,
R.drawable.sample_15
};
// Constructor
public ImageAdapter(Context c){
mContext = c;
}
@Override
public int getCount() {
return mThumbIds.length;
}
@Override
public Object getItem(int position) {
return mThumbIds[position];
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(final int position, View convertView,
ViewGroup parent) {
ImageView imageView;
if (convertView == null) { // if it's not recycled,
initialize some attributes
imageView = new ImageView(mContext);
imageView.setImageResource(mThumbIds[position]);
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setLayoutParams(new GridView.LayoutParams(300, 200));
imageView.setPadding(10, 10, 10, 10);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//Log.d("onClick","position ["+ position +"]");
//Toast.makeText(HotSalesFragment.this, "" + position,
Toast.LENGTH_SHORT).show();
}
});
} else {
imageView = (ImageView) convertView;
}
imageView.setImageResource(mThumbIds[position]);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//Log.d("onClick","position ["+position+"]");
if(position == 0){
Intent gk = new
Intent(getActivity().getApplicationContext(),
ShopsListsActivity.class);
startActivity(gk);
}
}
});
return imageView;
}
}
}
Note: In this fragment I want to view it as gridview. And both files works
fine. but when I tried to implement AsyncTask I gets several redflags as
unreachable code. Can some help me with this please?
Does PHP create the directory for the error log if it does not exists?
Does PHP create the directory for the error log if it does not exists?
Does PHP create the directory for the error log if it does not exists?
For example, the error_log directive is set to /var/logs/php/errors.log
but the folder /var/logs/php does not exists.
Does PHP create the directory for the error log if it does not exists?
For example, the error_log directive is set to /var/logs/php/errors.log
but the folder /var/logs/php does not exists.
Saturday, 31 August 2013
Javascript registry for calling methods and objects
Javascript registry for calling methods and objects
I want to have an object which can act as a registry for calling functions
on it.
So far, I have been thinking of something along these lines:
var registry = new Object();
registry.doStuff = function(){ /* */ };
Is there a better way ? What about adding objects ? Ideally, I'd like to
be able to add these at run time.
I want to have an object which can act as a registry for calling functions
on it.
So far, I have been thinking of something along these lines:
var registry = new Object();
registry.doStuff = function(){ /* */ };
Is there a better way ? What about adding objects ? Ideally, I'd like to
be able to add these at run time.
AutoCad: Getting 'Invalid object array exception' in Late Binding while copying Objects
AutoCad: Getting 'Invalid object array exception' in Late Binding while
copying Objects
I have two drawings, dg1 and dg2. I have defined a block 'b1' in dg1 which
I want to copy in dg2. It works well in Early Binding but giving error
when I try code in late binding. The code in question is:
myfile.CopyObjects(objCollection, m_oActiveDoc.Blocks)
And I get exception: Invalid object array exception while I try to copy a
block in other drawing.
How do I do it in late Binding?
I am using Autocad 2009
Thanks
copying Objects
I have two drawings, dg1 and dg2. I have defined a block 'b1' in dg1 which
I want to copy in dg2. It works well in Early Binding but giving error
when I try code in late binding. The code in question is:
myfile.CopyObjects(objCollection, m_oActiveDoc.Blocks)
And I get exception: Invalid object array exception while I try to copy a
block in other drawing.
How do I do it in late Binding?
I am using Autocad 2009
Thanks
Is it possible to post a data that is in a list through PHP to a MySQL database
Is it possible to post a data that is in a list through PHP to a MySQL
database
I have a function which creates a calendar, I want to be able to click the
individual dates and save a task in the database table, my function is
currently outputting this in an unordered list with list tags. How can I
submit this through PHP? Would I need to wrap this around in a form and
then use $_POST as per submitting a form? Or is there another procedure?
Does anyone have any working examples?
Forgive my ignorance. Thanks in advance for any help.
This is the calendar class that I am using:
<?php
class Calendar {
/**
* Constructor
*/
public function __construct(){
$this->naviHref = htmlentities($_SERVER['PHP_SELF']);
}
/********************* PROPERTY ********************/
private $dayLabels = array("Mon","Tue","Wed","Thu","Fri","Sat","Sun");
private $currentYear=0;
private $currentMonth=0;
private $currentDay=0;
private $currentDate=null;
private $daysInMonth=0;
private $naviHref= null;
/********************* PUBLIC **********************/
/**
* print out the calendar
*/
public function show() {
$year = null;
$month = null;
if(null==$year&&isset($_GET['year'])){
$year = $_GET['year'];
}else if(null==$year){
$year = date("Y",time());
}
if(null==$month&&isset($_GET['month'])){
$month = $_GET['month'];
}else if(null==$month){
$month = date("m",time());
}
$this->currentYear=$year;
$this->currentMonth=$month;
$this->daysInMonth=$this->_daysInMonth($month,$year);
$content='<div id="calendar">'.
'<div class="box">'.
$this->_createNavi().
'</div>'.
'<div class="box-content">'.
'<ul
class="label">'.$this->_createLabels().'</ul>';
$content.='<div class="clear"></div>';
$content.='<ul class="dates"
name="'.'$this->_showDay($i*7+$j), $month,
$year;'.'">';
$weeksInMonth =
$this->_weeksInMonth($month,$year);
// Create weeks in a month
for( $i=0; $i<$weeksInMonth; $i++ ){
//Create days in a week
for($j=1;$j<=7;$j++){
$content.=$this->_showDay($i*7+$j);
}
}
$content.='</ul>';
$content.='<div class="clear"></div>';
$content.='</div>';
$content.='</div>';
return $content;
}
/********************* PRIVATE **********************/
/**
* create the li element for ul
*/
private function _showDay($cellNumber){
if($this->currentDay==0){
$firstDayOfTheWeek =
date('N',strtotime($this->currentYear.'-'.$this->currentMonth.'-01'));
if(intval($cellNumber) == intval($firstDayOfTheWeek)){
$this->currentDay=1;
}
}
if( ($this->currentDay!=0)&&($this->currentDay<=$this->daysInMonth) ){
$this->currentDate =
date('Y-m-d',strtotime($this->currentYear.'-'.$this->currentMonth.'-'.($this->currentDay)));
$cellContent = $this->currentDay;
$this->currentDay++;
}else{
$this->currentDate =null;
$cellContent=null;
}
return '<li id="li-'.$this->currentDate.'"
name="'.$this->currentDate.'" class="'.($cellNumber%7==1?' start
':($cellNumber%7==0?' end ':' ')).
($cellContent==null?'mask':'').'">'.$cellContent.'</li>';
}
/**
* create navigation
*/
private function _createNavi(){
$nextMonth = $this->currentMonth==12?1:intval($this->currentMonth)+1;
$nextYear =
$this->currentMonth==12?intval($this->currentYear)+1:$this->currentYear;
$preMonth = $this->currentMonth==1?12:intval($this->currentMonth)-1;
$preYear =
$this->currentMonth==1?intval($this->currentYear)-1:$this->currentYear;
return
'<div class="header">'.
'<a class="prev"
href="'.$this->naviHref.'?month='.sprintf('%02d',$preMonth).'&year='.$preYear.'"><</a>'.
'<span class="title">'.date('Y
M',strtotime($this->currentYear.'-'.$this->currentMonth.'-1')).'</span>'.
'<a class="next"
href="'.$this->naviHref.'?month='.sprintf("%02d",
$nextMonth).'&year='.$nextYear.'">></a>'.
'</div>';
}
/**
* create calendar week labels
*/
private function _createLabels(){
$content='';
foreach($this->dayLabels as $index=>$label){
$content.='<li class="'.($label==6?'end title':'start title').'
title">'.$label.'</li>';
}
return $content;
}
/**
* calculate number of weeks in a particular month
*/
private function _weeksInMonth($month=null,$year=null){
if( null==($year) ) {
$year = date("Y",time());
}
if(null==($month)) {
$month = date("m",time());
}
// find number of days in this month
$daysInMonths = $this->_daysInMonth($month,$year);
$numOfweeks = ($daysInMonths%7==0?0:1) + intval($daysInMonths/7);
$monthEndingDay= date('N',strtotime($year.'-'.$month.'-'.$daysInMonths));
$monthStartDay = date('N',strtotime($year.'-'.$month.'-01'));
if($monthEndingDay<$monthStartDay){
$numOfweeks++;
}
return $numOfweeks;
}
/**
* calculate number of days in a particular month
*/
private function _daysInMonth($month=null,$year=null){
if(null==($year))
$year = date("Y",time());
if(null==($month))
$month = date("m",time());
return date('t',strtotime($year.'-'.$month.'-01'));
}
}
?>
database
I have a function which creates a calendar, I want to be able to click the
individual dates and save a task in the database table, my function is
currently outputting this in an unordered list with list tags. How can I
submit this through PHP? Would I need to wrap this around in a form and
then use $_POST as per submitting a form? Or is there another procedure?
Does anyone have any working examples?
Forgive my ignorance. Thanks in advance for any help.
This is the calendar class that I am using:
<?php
class Calendar {
/**
* Constructor
*/
public function __construct(){
$this->naviHref = htmlentities($_SERVER['PHP_SELF']);
}
/********************* PROPERTY ********************/
private $dayLabels = array("Mon","Tue","Wed","Thu","Fri","Sat","Sun");
private $currentYear=0;
private $currentMonth=0;
private $currentDay=0;
private $currentDate=null;
private $daysInMonth=0;
private $naviHref= null;
/********************* PUBLIC **********************/
/**
* print out the calendar
*/
public function show() {
$year = null;
$month = null;
if(null==$year&&isset($_GET['year'])){
$year = $_GET['year'];
}else if(null==$year){
$year = date("Y",time());
}
if(null==$month&&isset($_GET['month'])){
$month = $_GET['month'];
}else if(null==$month){
$month = date("m",time());
}
$this->currentYear=$year;
$this->currentMonth=$month;
$this->daysInMonth=$this->_daysInMonth($month,$year);
$content='<div id="calendar">'.
'<div class="box">'.
$this->_createNavi().
'</div>'.
'<div class="box-content">'.
'<ul
class="label">'.$this->_createLabels().'</ul>';
$content.='<div class="clear"></div>';
$content.='<ul class="dates"
name="'.'$this->_showDay($i*7+$j), $month,
$year;'.'">';
$weeksInMonth =
$this->_weeksInMonth($month,$year);
// Create weeks in a month
for( $i=0; $i<$weeksInMonth; $i++ ){
//Create days in a week
for($j=1;$j<=7;$j++){
$content.=$this->_showDay($i*7+$j);
}
}
$content.='</ul>';
$content.='<div class="clear"></div>';
$content.='</div>';
$content.='</div>';
return $content;
}
/********************* PRIVATE **********************/
/**
* create the li element for ul
*/
private function _showDay($cellNumber){
if($this->currentDay==0){
$firstDayOfTheWeek =
date('N',strtotime($this->currentYear.'-'.$this->currentMonth.'-01'));
if(intval($cellNumber) == intval($firstDayOfTheWeek)){
$this->currentDay=1;
}
}
if( ($this->currentDay!=0)&&($this->currentDay<=$this->daysInMonth) ){
$this->currentDate =
date('Y-m-d',strtotime($this->currentYear.'-'.$this->currentMonth.'-'.($this->currentDay)));
$cellContent = $this->currentDay;
$this->currentDay++;
}else{
$this->currentDate =null;
$cellContent=null;
}
return '<li id="li-'.$this->currentDate.'"
name="'.$this->currentDate.'" class="'.($cellNumber%7==1?' start
':($cellNumber%7==0?' end ':' ')).
($cellContent==null?'mask':'').'">'.$cellContent.'</li>';
}
/**
* create navigation
*/
private function _createNavi(){
$nextMonth = $this->currentMonth==12?1:intval($this->currentMonth)+1;
$nextYear =
$this->currentMonth==12?intval($this->currentYear)+1:$this->currentYear;
$preMonth = $this->currentMonth==1?12:intval($this->currentMonth)-1;
$preYear =
$this->currentMonth==1?intval($this->currentYear)-1:$this->currentYear;
return
'<div class="header">'.
'<a class="prev"
href="'.$this->naviHref.'?month='.sprintf('%02d',$preMonth).'&year='.$preYear.'"><</a>'.
'<span class="title">'.date('Y
M',strtotime($this->currentYear.'-'.$this->currentMonth.'-1')).'</span>'.
'<a class="next"
href="'.$this->naviHref.'?month='.sprintf("%02d",
$nextMonth).'&year='.$nextYear.'">></a>'.
'</div>';
}
/**
* create calendar week labels
*/
private function _createLabels(){
$content='';
foreach($this->dayLabels as $index=>$label){
$content.='<li class="'.($label==6?'end title':'start title').'
title">'.$label.'</li>';
}
return $content;
}
/**
* calculate number of weeks in a particular month
*/
private function _weeksInMonth($month=null,$year=null){
if( null==($year) ) {
$year = date("Y",time());
}
if(null==($month)) {
$month = date("m",time());
}
// find number of days in this month
$daysInMonths = $this->_daysInMonth($month,$year);
$numOfweeks = ($daysInMonths%7==0?0:1) + intval($daysInMonths/7);
$monthEndingDay= date('N',strtotime($year.'-'.$month.'-'.$daysInMonths));
$monthStartDay = date('N',strtotime($year.'-'.$month.'-01'));
if($monthEndingDay<$monthStartDay){
$numOfweeks++;
}
return $numOfweeks;
}
/**
* calculate number of days in a particular month
*/
private function _daysInMonth($month=null,$year=null){
if(null==($year))
$year = date("Y",time());
if(null==($month))
$month = date("m",time());
return date('t',strtotime($year.'-'.$month.'-01'));
}
}
?>
Split String in clojure and then print.
Split String in clo​j​ure and then print.
I'm new to clo​j​ure. I want to split a String and then print.
If I do :
(.split "Dasher Dancer Prancer" " "))
It gives the #<String[] [Ljava.lang.String;@64e0e8ca> which is just the
toString() of the array.
I'm new to clo​j​ure. I want to split a String and then print.
If I do :
(.split "Dasher Dancer Prancer" " "))
It gives the #<String[] [Ljava.lang.String;@64e0e8ca> which is just the
toString() of the array.
Subscribe to:
Posts (Atom)