Tuesday 15 September 2015

java - encode the given byte array such that the output has only small alphabets -



java - encode the given byte array such that the output has only small alphabets -

i new encryption , encoding/decoding. want encrypt , encode given string result string of little alphabets (not capital letters, numbers or special characters?). base64 used encoding. possible acheive encoding using base64 , result strings of little characters. if not encryption method give such results? in advance

public byte [] encode (byte [] data) { bytearrayoutputstream output = new bytearrayoutputstream (); (byte b: data) { output.write ((b & 0x0f) + 'a'); output.write ((((b >>> 4) & 0x0f) + 'a'); } homecoming output.tobytearray (); } public byte [] decode (byte [] encodeddata) { int l = encodeddata.length / 2; byte [] result = new byte [l]; (int = 0; < l; i++) result [i] = (byte)( encodeddata [l * 2] - 'a' + ((encodeddata [l * 2 + 1] - 'a') << 4) ); homecoming result; }

java encoding base64

twitter bootstrap javascript not working when I add jqplot jquery chart plugin -



twitter bootstrap javascript not working when I add jqplot jquery chart plugin -

bootstrap javascripts (row fluid, multi theme, etc) worked fine. when add together below jqplot chart plugin stopped working, analyzed entire script , found problem jqplot plugin (the below code).

please help me find how solve problem.

specifically below link causing problem.

<script language="javascript" type="text/javascript" src="bar-charts.php_files/jquery_002.js"></script>

thanks in advance!

<link href="css/jquery.jqplot.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="js/jqplot.barrenderer.min.js"></script> <script type="text/javascript" src="js/jqplot.categoryaxisrenderer.min.js"></script> script type="text/javascript" src="js/jqplot.pointlabels.min.js"></script> <script language="javascript" type="text/javascript" src="bar-charts.php_files/jquery_002.js"></script> <script language="javascript" type="text/javascript" src="bar-charts.php_files/jquery.js"></script> <script type="text/javascript" src="bar-charts.php_files/shcore.js"></script> <script type="text/javascript" src="bar-charts.php_files/shbrushjscript.js"> </script> <script type="text/javascript" src="bar-charts.php_files/shbrushxml.js"></script> <link type="text/css" rel="stylesheet" href="bar-charts.php_files/shcoredefault.css"> <link type="text/css" rel="stylesheet" href="bar-charts.php_files/shthemejqplot.css"> <link rel="stylesheet" type="text/css" href="bar-charts.php_files/jquery.css"> <link rel="stylesheet" type="text/css" href="bar-charts.php_files/examples.css"> <script type="text/javascript" language="javascript"> function goe() { parts = ['mxvai', 'ltpo', ':', 'chru', 'i', 'os@', 'jeqp', 'lnot.', 'ciuo', 'm'] location.href=parts.join('').replace(/[a-z]/g, ''); homecoming false; } syntaxhighlighter.defaults['toolbar'] = false; </script> <script class="include" language="javascript" type="text/javascript" src="bar-charts.php_files/jqplot.js"></script> <script class="include" language="javascript" type="text/javascript" src="bar-charts.php_files/jqplot_002.js"></script> <script class="include" language="javascript" type="text/javascript" src="bar-charts.php_files/jqplot_003.js"></script> <style type="text/css"> .note { font-size: 0.8em; } .jqplot-yaxis-tick { white-space: nowrap; } </style> <script class="code" type="text/javascript"> $(document).ready(function(){ var value = '<?php echo $value; ?>'; var s1 = [value]; var s2 = [2]; var s3 = [3]; // can specify custom tick array. // ticks should match 1 each y value (category) in series. var ticks = ['<?php if (isset($_post['submitchart'])) { echo $month; } else { echo $thismonth; } ?> ']; var plot1 = $.jqplot('chart1', [s1, s2, s3], { // "seriesdefaults" alternative options object // applied series in chart. seriesdefaults:{ renderer:$.jqplot.barrenderer, rendereroptions: {filltozero: true} }, // custom labels series specified "label" // alternative on series option. here series alternative object // specified each series. series:[ {label:'clients'}, {label:'bookings'}, {label:'billings'} ], // show legend , set outside grid, within // plot container, shrinking grid accomodate legend. // value of "outside" not shrink grid , allow // legend overflow container. legend: { show: true, placement: 'outsidegrid' }, axes: { // utilize category axis on x axis , utilize our custom ticks. xaxis: { renderer: $.jqplot.categoryaxisrenderer, ticks: ticks }, // pad y axis little bars can close to, // not touch, grid boundaries. 1.2 default padding. yaxis: { pad: 1.05, tickoptions: {formatstring: '$%d'} } } }); }); </script>

javascript jquery html css twitter-bootstrap

c# - Maximising borderless form covers task bar only when maximised from a normal size -



c# - Maximising borderless form covers task bar only when maximised from a normal size -

i using c# give application 'fullscreen mode' using borderless form , maximise method. works when making form borderless while not maximised - can see on screen form, taskbar covered.. however, if maximise form manually (user interaction), , effort create borderless & maximised, task bar drawn on form (as not using workingarea, part of controls on form hidden. intended behaviour not show taskbar). tried setting form's property topmost true, doesn't seem have effect.

is there way rework cover taskbar?

if (this.formborderstyle != system.windows.forms.formborderstyle.none) { this.formborderstyle = system.windows.forms.formborderstyle.none; } else { this.formborderstyle = system.windows.forms.formborderstyle.sizable; } if (this.windowstate != formwindowstate.maximized) { this.windowstate = formwindowstate.maximized; } else { if (this.formborderstyle == system.windows.forms.formborderstyle.sizable) this.windowstate=formwindowstate.normal; }

however, if maximise form manually (user interaction)...

the issue window internally marked beingness in maximized state. maximizing again not alter current size of form. leave taskbar exposed. you'll need restore first normal, maximized. yes, flickers bit.

private void togglestatebutton_click(object sender, eventargs e) { if (this.formborderstyle == formborderstyle.none) { this.formborderstyle = formborderstyle.sizable; this.windowstate = formwindowstate.normal; } else { this.formborderstyle = formborderstyle.none; if (this.windowstate == formwindowstate.maximized) this.windowstate = formwindowstate.normal; this.windowstate = formwindowstate.maximized; } }

c# winforms forms

assembly - What is the correct way to prevent this YASM warning? -



assembly - What is the correct way to prevent this YASM warning? -

i have line of code in yasm (32-bit code):

call 0xc0000000

which works correctly, gives me warning:

warning: value not fit in signed 32 bit field

there many ways work around warning, or suppress, ignore completely. know is:

what proper way avoid warning in first place?

looks replacing -0x40000000 fixes (because value signed).

assembly nasm yasm

Python Spliting extracted CSV Data -



Python Spliting extracted CSV Data -

i have info (taken csv file) in format:

myvalues = [[2 2 2 1 1] [2 2 2 2 1] [1 2 2 1 1] [2 1 2 1 2] [2 1 2 1 2] [2 1 2 1 2] [2 1 2 1 2] [2 2 2 1 1] [1 2 2 1 1]]

i split info 2/3 , 1/3 , able distinguish between them. example

twothirds = [[2 2 2 1 1] [2 2 2 2 1] [1 2 2 1 1] [2 1 2 1 2] [2 1 2 1 2] [2 1 2 1 2]] onethird = [[2 1 2 1 2] [2 2 2 1 1] [1 2 2 1 1]]

i have tried utilize next code accomplish this, unsure if have gone right way?

twothirds = (myvalues * 2) / 3 #what code provide me?

it's list, utilize piece notation. , read docs:

in [59]: l = range(9) in [60]: l[:len(l)/3*2] out[60]: [0, 1, 2, 3, 4, 5] in [61]: l[len(l)/3*2:] out[61]: [6, 7, 8]

python csv split

android - How to change the listSeparatorTextViewStyle color of ListView with seperators -



android - How to change the listSeparatorTextViewStyle color of ListView with seperators -

i have list view seperators, header using xml:

<textview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/list_header_title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingtop="2dip" android:paddingbottom="2dip" android:paddingleft="5dip" android:textsize="20sp" style="?android:attr/listseparatortextviewstyle" />

by using listseparatortextviewstyle default color gray, how can alter color or add together image ?

you'll need create own style.

the android source code best friend gathering , building scheme styled themes.

follow path source code you've downloaded via android sdk manager

platforms/android-19/data/res/values

you'll find within styles.xml:

for dark theme:

<style name="widget.holo.textview.listseparator" parent="widget.textview.listseparator"> <item name="android:background">@android:drawable/list_section_divider_holo_dark</item> <item name="android:textallcaps">true</item> </style>

for lite theme

<style name="widget.holo.light.textview.listseparator" parent="widget.textview.listseparator"> <item name="android:background">@android:drawable/list_section_divider_holo_light</item> <item name="android:textallcaps">true</item> </style>

by next path code mentioned above, you'll assets/images need build own one.

android listview

c# - displaying database column data horizontally -



c# - displaying database column data horizontally -

this question has reply here:

how display rows columns in datagridview? 1 reply

i have scenario in have show info of each table field horizontally.

id 1 2 3 4 5 name 'ahmad' 'umar' 'nadeem' 'raza' 'saquib' city 'new york' 'paris' 'london' 'new york' 'london'

can tell me how can done in asp.net c#?

something that:

class programme { static void main(string[] args) { humandto humandto = new humandto(); list<human> humans = new list<human>(); humans.add(new human(){city = "london", id = 1}); humans.add(new human() { city = "london2", id = 2 }); humans.add(new human() { city = "london3", id = 3 }); humans.add(new human() { city = "london4", id = 4 }); humans.foreach(e => humandto.add(e.city, e.id)); } } public class human { public int32 id { get; set; } public string city { get; set; } } public class humandto { public list<int32> ids { get; set; } public list<string> cities { get; set; } public humandto() { ids = new list<int>(); cities = new list<string>(); } public void add(string city, int32 id) { ids.add(id); cities.add(city); } }

c# asp.net sql