Posts

Showing posts from June, 2012

c# - Can';t work using html textbox to login -

Image
because using html buttons , textbox login, must code behind in javascript in source code in order code behind. whether login using correct username , password admin , 123 , click login button, or type in nothing , click login button, redirects me resultdetails.aspx. means login fail. login pass if redirect me search.aspx. what's wrong? if change .value .text, still same effect my source code <%@ page language="c#" autoeventwireup="true" codefile="login.aspx.cs" inherits="login" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> </style> <link rel="stylesheet" type="text/css" href="stylesheets/loginstyle.css"...

R `parallel` package does not exist on CRAN? -

i tried google "r package parallel" have not found on cran. tried following links, not work: http://cran.r-project.org/web/packages/parallel/index.html http://cran.r-project.org/web/packages/parallel http://cran.r-project.org/package=parallel it absent in list of available.packages() . but apparently package parallel does exist! :-) have in list of packages , has own tag here :-) is because inside r-core since 2.14.0 ? http://stat.ethz.ch/r-manual/r-devel/library/parallel/doc/parallel.pdf

osx - OS X application is keep being killed after OS migration -

one of users of os x application has migrated mac new mbp , application, sandboxed, signed w/ developer-id certificate, , ad-hoc distributed, keep being killed. @ console, found following logs. xpcd[352]: restored permissions (100600 -> 100700) on /users/myname/library/containers/com.company.appmac/container.plist com.apple.launchd.peruser.501[342]: (com.company.appmac.63040[1567]) exited: killed: 9 com.apple.launchd.peruser.501[342]: (com.company.appmac.63040[1598]) exited: killed: 9 com.apple.launchd.peruser.501[342]: (com.company.appmac.63040[1616]) exited: killed: 9 i have no clue caused kind of error. how can fix it? could code-signing issue. maybe related not signing nested bundles (see http://furbo.org/2013/10/17/code-signing-and-mavericks/ )

c# - Sort XmlNodeList with a specific Node value -

i searched web this, not able find related solution. i have following xml <table> <entity>employee</entity> <entityid>2786</entityid> <goal> <goalid>31931</goalid> <filterdata>lastmodifiedon¥2014-03-20t18:11:01.0000000+05:30Æactivetaskcount¥0</filterdata> </goal> <goal> <goalid>31932</goalid> <filterdata>lastmodifiedon¥2014-03-22t15:26:09.0000000+05:30Æactivetaskcount¥0</filterdata> </goal> <goal> <goalid>31932</goalid> <filterdata>lastmodifiedon¥2014-03-22t09:25:00.0000000+05:30Æactivetaskcount¥0</filterdata> </goal> </table> from above xml when read data got 2 separate datatables ; 1 employees , 1 related goals. what needed want sort goals related employee respect lastmodifiedon filterdata node. note: getting lastmodifiedon value split node value this ...

html - Remove horizontal scrolling in IE 8-10 using overflow-x:hidden -

on firefox, chrome , safari, following css sets width of document screen size, , clips outside of it. body, html { overflow-x:hidden; width:100%; } this allows create background elements larger width of documents , have them not change final size of document. unfortunately ie doesn't seem allow approach (i've tested ie 8-10), , though supports overflow-x , wont show scroll-bar, can still scroll horizontally highlighting content , dragging right. is there anyway work in ie? ie not support overflow element in css you have use max-height property element.

android - How to change the default EditText text size -

i trying change default edittext style, have done textview style following way: <style name="mytextviewstyle" parent="android:widget.textview"> <item name="android:textcolor">@color/pink</item> <item name="android:textsize">@dimen/textsize</item> </style> and using android:textviewstyle style <style name="appbasetheme" parent="theme.appcompat.light"> <item name="android:textviewstyle">@style/mytextviewstyle</item> </style> how can achieve same edittext ? you use code in project can required edittext style throughout project... <style name="myapptheme" parent="android:theme.light"> <item name="android:edittextstyle">@style/customedittextstyle</item> </style> <style name="customedittextstyle"> <item name="android:background">@drawable/ed...

apache - Java HttpClient Add Header and Credentials To Get Auth Cookie Back -

i've been trying week response server. requires username, password, , custom header authorization code. have far , have verified many times information log in server correct. when use information on google postman true response along cookie need when in java false , no cookie. i'm confused... i'm sending message correctly? httpclient httpclient = new defaulthttpclient(); httpclient.getparams().setparameter("username", user); httpclient.getparams().setparameter("password", pass); httppost httppost = new httppost(loginurl); httppost.addheader(authname, stageapi); httpresponse httpresponse = httpclient.execute(httppost);

How to insert SDO_GEOMETRY object variable from C# code into oracle table containing coloumn of sdo_geometry type? -

i having sdo_geometry object variable fetches sdo_geometry type data map. need save data table sdo_geometry field. able fetch sdo_geometry field table , use , blocked in saving fetched sdo_geometry field. i have stored procedure can take sdo_geometry type variable input. p_geometry in mdsys.sdo_geometry, -- input parameter of stored procedure my code provides sdo_geometry type of object : parameter.addwithvalue("p_geometry", geom, oracledbtype.object, parameterdirectionwrap.input); where geom sdo_geometry class object contains sdo_geometry field. error getting in sample .net application invalid parameter binding parameter name: p_geometry which best way avoid problem. you have 2 choices: can write wrapper pl/sql procedure takes whatever input decide , sets call using sdo_geometry within pl/sql. or can use oracle developer tools visual studio custom class wizard generate c# code maps sdo_geometry user defined type. to latter: ...

rotation - rotate Image on openGL -

i loading model on opengl. when save model tiff file, can see mirror pic of x axis . how can change can see loads on opengl? how can fix can see model in irfan view see in opengl? when open irfan view model seen mirror toward down... thanks

How do I initialize an array with the address of another array in C++? -

say have class class1 array declared array1 , in class1.h , have like class class1{ public: int array1[2]; } and later, in different class's .cpp file, have class1* class = new class1(); int array0[2]; array0 = class->array1; however, gives me error invalid array assignment how can set addresses of arrays equal each other can modify remotely? you can't refer array array. have either bind reference array of same type, or use array-like type such std::array<int, 2> . array reference: class1 a; int (&array0)[2] = a.array1; // array0 reference a.array1 std::array reference: #include <array> class class1{ public: std::array<int, 2> array1; }; then class1 a; std::array<int, 2>& array0 = a.array1; // array0 reference a.array1 both these approaches ensure full type information of array available via reference. means, example, can use references std::begin , std::end or in range-based for-loop. n...

batch file - Next button is not getting enabled after started a java process -

i developing installer windows based , have written batch file install dependencies application. after successful dependencies installation going install application. here question after successful application installation want start server(its java process, keep running until stop) automatically starting manually. here after started server part of app installation next button in * installpanel not enabled. * this executable info executable targetfile="$install_path/install_script.bat" stage="postinstall" keep="false" failure="abort" am using izpack 5 version. note : if stop java process , next button in installpanel getting enabled. can please me out? thanks in advance.

c# - Array to CheckboxList and again to array -

hi have little problem. items array this.headerfields = new string[]{ "proj_id", "model", "esn", "location", "datatype", "testtype", "test", "trrdg", "rdg", "testdate", "testtime" }; and set them checkedlistbox line of code checkedlstboxheaderfield.items.addrange(settings.headerfields); controls.add(checkedlstboxheaderfield); that works. when open winforms want check of values , ok button go nextstep , when reopen form want see items checked , unchecked. try settings.headerfields = checkedlstboxheaderfield.checkeditems.oftype<string>().toarray(); but these line of code became checked items. please help.... settings.headerfields = checkedlstboxheaderfield.items.oftype<string>().toarray();

Javascript Concatenation -

this question has answer here: javascript: array plus number [duplicate] 3 answers i came across following snippet of codes in javascript quiz online. not understand how concatenation works in js. can 1 explain how works ? [] + [] = "" // output : "" [] + [] + "foo" // output : "foo" javascript tries apply + operator in different ways, it's been taught to. so unless explicitly told, calls tostring method of array it's best guess when it's told add 2 arrays. [] + [] = "" +[] + [] = "0" // if give hint cast 1 of array number +[] + +[] = 0 // if give hint cast both arrays number while [] + [] + "foo" ([] + []) + "foo" = "" + "foo" = "foo"

android - White Toggle Button on NavigationDrawer -

Image
i've developed navigation drawer app, toggle button shown in white. image button and how shown on app does know why happends? you make sure app theme if having theme black apply theme in application mainfest file <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@android:style/theme.holo.light" > ...... .... </application> afterwards getting same pblm make sure in drawable folder image gray color image or not...

javascript - Problems with Get / Set value to text -

i'm trying when press button (get value) set size of checkboxes text. make variable (numall) global, , convert tostring, still not working. idea solve solution? demo jquery: $(function () { // click function add card var $div = $('<div />').addclass('sortable-div'); $('<label>title</label><br/>').appendto($div); $('<input/>', { "type": "text", "class": "ctb" }).appendto($div); $('<input/>', { "type": "text", "class": "date" }).appendto($div); $('<input/>', { "type": "text", "class": "cbox" }).appendto($div); var cnt = 0, $currenttarget; $('#addcardbtn').click(function () { var $newdiv = $div.clone(true); cnt++; $newdiv.pr...

html - Fonts are not working in IE -

code : @font-face { font-family: 'gothamrnd-medium'; src: url('about/fonts/gothamrnd-medium/gothamrnd-medium.eot'); src: url('about/fonts/gothamrnd-medium/gothamrnd-medium.eot?#iefix') format('embedded-opentype'), url('about/fonts/gothamrnd-medium/gothamrnd-medium.woff') format('woff'), url('about/fonts/gothamrnd-medium/gothamrnd-medium.ttf') format('truetype'), url('about/fonts/gothamrnd-medium/gothamrnd-medium.svg#gothamrnd-medium') format('svg'); font-weight: normal; font-style: normal; } @font-face { font-family: 'archerbolditalic'; src: url('about/fonts/archer-boldital/archer-boldital.eot'); src: url('about/fonts/archer-boldital/archer-boldital.eot?#iefix') format('embedded-opentype'), url('about/fonts/archer-boldital/archer-boldital.woff') format('woff'), url(...

how to change android app name in the build gradle file -

i'm creating different flavors using gradle 2 small android apps ,i wanna know if can edit app name on xml file in build.gradle , different flavors . what mean app name ? application package name in manifest or application name appears in launcher? if former, do: android { productflavors { flavor1 { packagename 'com.example.flavor1' } flavor2 { packagename 'com.example.flavor2' } } } it's possible override app name you'd have provide flavor overlay resource instead. so create following files: src/flavor1/res/values/strings.xml src/flavor2/res/values/strings.xml and in them override string resource contains app name (the 1 manifest use main activity label through @string/app_name ). can provide different translations needed.

php - array_diff on assoc array only showing the first result and not all -

this continuation question forgot ask full question. luck did because ask wrong question. ok have following 2 arrays array ( [idasset] => 10000005 [assetname] => hp ) array ( [idasset] => 10000006 [assetname] => hp server ) array ( [idasset] => 10000009 [assetname] => hp laptop ) array ( [idasset] => 10000010 [assetname] => office printer ) array ( [idasset] => 10000023 [assetname] => test ) array ( [idasset] => 10000023 [assetname] => test ) i got these using following code $firstarray = array(); $secondarray = array(); do{ array_push($firstarray,$array1); }while($array1 = mysql_fetch_assoc($assetup)); do{ array_push($secondarray ,$array2); }while($array2 = mysql_fetch_assoc($docup)); $array3 = array_diff_key($firstarray, $secondarray); print_r($array3); however leaves me following: array ( [2] => array ( [idasset] => 10000006 [assetname] => hp server ) [3] => array ( [idasset] =...

angularjs - Search Filter using angular, How to use '| filter: 'some text' from controller -

what wrong in this: jsfiddle.net/tty4l/3/ i trying make filter kind of list, when enter value, 'avi', should list avi ravi, i know logic so, {{['avi','ravi','raj','raghuram'] | filter:'avi'}}, not able get, how put in controller, , display there, can use $filter this, if yes, how can i. try this: <li ng-repeat="searchitem in searchitems | filter:searchfilter">{{searchitem}}</li> abd here fiddle

How to set session variable in jquery/css? -

jquery(document).ready(function($){ $("#a2").click(function(){ $('body').css("csstext","font-size: 107% !important"); }); }); jquery(document).ready(function($){ $("#a3").click(function(){ $('body').css("csstext","font-size: 114% !important"); }); }); jquery(document).ready(function($){ $("#a4").click(function(){ $('body').css("csstext","font-size: 121% !important"); }); }); i have given a2, a3, a4 ids a, a+, a++ buttons. whenever visitor of site click on 1 of these buttons, font-size of whole site change accordingly. right font-size changing when refresh page, again showing default font-size. how can that? need use session? , how can use in css or jquery ? new in website development. please me. following code have written , working perfectly. sharing other can refer it. jquery(document).ready(function($){...

javascript - How to pass element parameter to require.js define call? -

i have page split "widgets" loaded dynamically on fly - js require.js, html & css custom js. handy because allows each widget define it's own js requirements. for example: define(['jquery', 'mustache'], function($, mustache) { ... however, in order target widget js functionality correct element, need pass widgets root element javascript, loaded require.js, require.js doesn't support... :/ what have this, define call returns function rendering... // example.js define(['jquery'], function($) { return function($el) { // render widget here "$el" $el.html('asdsadads'); } }); ... run require call... require(['js/example'], function(render) { render($el); }); ... works ok simple structures more complex widgets, init function starts bloat, makes less pretty , harder read (also, more prone bugs). the optimal situation this... // example.js define(['jquery'], function(...

powershell - Importing registry (.reg) files fails -

i'm having trouble importing .reg files on windows server 2012. script works on server 2008, works when typed @ powershell prompt, , works when run "double-click" on server 2012 instance. the script unzips file containing .reg files, imports them registry. write-output "unzipping aux package" unzip-file -file "$download_dir\$s3_aux_package" -destination $destinationfolder write-output "done unzipping aux package" # import registry files in aux archive package $registryfiles = get-childitem $destinationfolder | {$_.extension -eq ".reg"} $registryfiles = $registryfiles | % {$_.name} foreach ($regfile in $registryfiles) { move "$destinationfolder\$regfile" "$download_dir" $cmd = "regedit /s `"$download_dir\$regfile`" " write-output "$cmd" invoke-expression $cmd } i can see the correct parameters , file names appear write-output entries: un...

wxpython - wxWidgets 2.8 (and before) wxTreeListCtrl missing, what did we do before 2.9? -

in wxpython 2.6 , above there's "gizmo" - wxtreelistctrl name suggests tree view columns, or list view column represented tree. i've come wxpython wxwidgets , wxtreelistctrl added in 2.9.3 (documentation). what did people before? 20 years (1993?) can't have elapsed python lot going "you know what, i'd love columns on tree data...", i've been searching , searching it's hard, @ time nobody specified "wx 2.8" or 2.6, , it's hard separate results pertaining 2.9 , above. why ask here. at least in 2.8.9 have used wxdataviewctrl display tree data. havent checked documentation earlier releases suppose same then.

command line - Silent installation of codecs -

background: i've been using k-lite codec pack installing video , audio codecs required playing media files in windows via silent/unattended installation works fine. i interested in figuring out how silent installs of k-lite behave when previous installs of k-lite exist. case silent/unattended installs of new versions can reliably run on top of old ones? possible silent un-install well? alternatively kind of command line tool exist (g-spot?) can detect presence of codecs have been installed, or if there way of doing programmatically in c++? i keen hear experience of this. ok. have figured out. after having first created silent install via k-lite-codec_pack-xyz.exe -makeunattended ... , running batch file gets created ... that's there it! newer versions of k-lite can comfortably installed on top of old ones, though care should taken in upgrading old k-lite version. more information point, see relevant section of faq . it's possible run sile...

java - Is it possible to lose precision while calulating 1/val twice? -

if have double d; if do: d = 1/d; d = 1/d; is possible lose precision? in case example? yes, ofcourse it's possible loose precision. floating-point types such float , double not infinitely precise. double d = 123456789.0; system.out.println(d); d = 1 / d; d = 1 / d; system.out.println(d); output: 1.23456789e8 1.2345678899999999e8

Handling views for multiple controllers in spring -

i have started spring project have multiple controllers. there way group vies each controller in separate folder inside web-inf? let me explain: when have 1 controller only, have 1 folder web-inf/jsp, referenced block in spring-servlet.xml (or whatever name was): <context:component-scan base-package="com.horariolivre.controller.primarycontroller"/> <bean id="viewresolver" class="org.springframework.web.servlet.view.urlbasedviewresolver"> <property name="viewclass" value="org.springframework.web.servlet.view.jstlview" /> <property name="prefix" value="/web-inf/jsp/" /> <property name="suffix" value=".jsp" /> </bean> in project, want have @ least 4 folder, 1 each controller, in way can create mappings that: @controller @requestmapping(value="acesso") public class primarycontroller { @autowired private ...

vb.net - Remove Event by Name -

i want remove specific handler winforms control visualbasic .net. for example: i have windows.forms.toolstripbutton click-event registered save data. now need remove event button, have no access registerd event-method !! pnly know handle used. in case "click" for better understanding: have write extension gridview. when multiple lines selected, have integrate mass-editing selected rows. need register new click event savebutton , remove old one. have no acces address of event handler. have button registered event this tried far: dim btnsaveeventinfo = btnsave.gettype.getevent("click") dim method = activator.createinstance(btnsaveeventinfo.gettype, true) removehandler btnsave.click, method this throws invalidcastexception anyone idea? gr33tz gangfish wow. harder nut crack expected. possible this, i'll warn you, it's real mess. ultimately, need delegate object event. once have that, removing event handler easy because can th...

jquery - how web service orchestration is possible via java program -

helo all. doing final year project in java web service. developing graphical user interface orchestration tool. in web services combined , needs testing in testing gui tool. now, have no idea in format, have combine service , test it. please suggest me way, or language, or ideas please. more helpful me. thank you. i suggest take task definition , try refactor , cut down list of needs , functionalities . it'll easier determine resources , tools need, , how attack problem. if need ideas project, take @ this: brainstorming guideline

jquery - How to validate three fields so one always has a value -

i have following 3 fields: 1st field : <input class="emailrequerido" name="emailrecomendado1_<?php echo $patrocinado->idpatroc; ?>" id="emailrecomendado1_<?php echo $patrocinado->idpatroc; ?>" placeholder="user@domain.com" type="text" /> 2nd field : <select name="contactos<?php echo $patrocinado->idpatroc; ?>[]" id="contactos<?php echo $patrocinado->idpatroc; ?>" multiple="3" style="width:49%" class="contactorequerido"> 3rd field : <select name="grupos<?php echo $patrocinado->idpatroc; ?>[]" id="grupos<?php echo $patrocinado->idpatroc; ?>" multiple="3" style="width:49%" class="gruporequerido"> submit field : <input id="enviarform" type="submit" class="uk-button uk-float-right" value="<?php echo jtext::_(...

C++ heap corrupt -

int main() { int = 3; int arr[] = { 5, 3, 6 }; vect v(a, arr); v.add(1); v.add(2); v.add(3); v.add(4); return 0; } vect class: int n; int* ptr = new int[n]; constructor: vect(int ninit, int arr[]) { n = ninit; (int = 0; < n; i++) { ptr[i] = tab[i]; } } add method in vect class: void add(int value) { n += 1; ptr[n-1] = value; } i'm getting error program.exe has triggered breakpoint. @ msvcr120d.dll!_heap_alloc_base(unsigned int size) line 58 . i've tried using memcpy . the interesting thing when call add once or twice, or when sending 1 int in arr array, okay. what going wrong here? main source of problem is: void add(int value) { n += 1; ptr[n-1] = value; // danger !!!! } you're creating memory of size 'n' using new int* ptr = new int[n]; but in function void add(int value) you're trying store numbers in location out of allocated memory (...

facebook - I can't use "friends locations" with the Graph api explorer anymore -

as title says, can no longer use friends locations graph api explorer more(in https://developers.facebook.com ). if click access token checkboxes,(trying me/friends?fields=locations.fields(place)) still error( { "error": "request failed" }). me/locations?fields=place works, must someting "friends" makes crash. able use 2 weeks ago, , have not done changes, stoped working. if login test account can parameters request, not on primary account. there 1 has idea problem can be? or why occurred? have done can think of, using diffrent web browers, deleting history, use diffrent computer. have compared settings both test account , main account, both have same settings. i sincerely sorry if have misspelled anything. it happens me of locations methods, location method out s works. don't know if data usable you. me/friends?fields=location,hometown

c - How to modify fork () function? -

i new operating systems , working on os project, want know way through can make changes fork function (a function creates child process). don't know whether fork runs on windows or on linux. i want make changes fork , i.e should print whether child process created or not, purpose somehow needs definition of fork function unable find. i know exists in <sys/types.h> , don't know where. i can gives me way or give fork function definition, 'll great, further update self. you can not modify fork . it's system call (with libc wrapper normally). it's unix specific , not exist in same form in windows. it returns 1 of 3 possible values: 0) returned in child! positive number) child process id returned in parent negative number) failure create child, check errno reasons. example use: pid_t child_pid = fork(); if (!child_pid) { // child goes here } else if (child_pid > 0) { // parent goes here } else { // not create chil...

regex - Only accept 11 digits in a IntegerField (not less than 11, and not more than 11) -

i have integerfield, want input accept value of 11 digits/numbers. i have tried make regex validator on field, problem when try make model form field. validation-error if value 10 digits or less, if try value 12 digits , upwards, don't validation error. here model field: number = models.integerfield(max_length=11, validators=[regexvalidator(r'\d{11,11}','number must 11 digits','invalid number')]) how can make validation error if value more 11 digits? not sure django syntax, have use anchors: r'^\d{11}$'

javascript - Xpages - Remove selected items from an array -

does know how remove selected items array? var view:notesview = getcomponent("viewpanel2"); var utbildningararray = new array(); viewscope.col = view.getselectedids(); if (viewscope.col.length > 0){ (i=0; i<viewscope.col.length; i++){ var docid = viewscope.col[i]; if (docid != null) { var doc = database.getdocumentbyid(docid); utbildningararray.push(doc.getitemvaluestring("namn")) } } } document1.removeitemvalue("utbildningar",utbildningararray); document1.save(); i have tried, removeentry , splice don't work. thanks, jonas edit: you right, have added in code: var view:notesview = getcomponent("viewpanel2"); var utbildningararray = new array(); var utbildningararray = new array(); var fieldutbarray = new array(getcomponent('inputhidden1').getvalue()); viewscope.col = view.getselectedids(); if (viewscope.col.length > 0){ (i=0; i<viewscope.col.length; i++){...

merge - Git --no-merged with --squash -

i prefer merge feature branches --squash lets me track when features added, , complete features need bisect on. find gives nice representation of state of stable branch on time. however, when using --squash branches merged appear under --no-merged instead of under --merged . makes difficult keep track of state of each branch (i.e. when finished). not want delete 'finished' branches has happened have had check them out bisect further , other reasons (sometimes problem requires multiple paths of attack until solved, , have found valuable have documented). it there way either: have --merged , --no-merged recognise squashed branches have in fact been merged. or archive merged (squashed) branches in sense not appear in either listing, still available if need them. i prefer second solution if possible. there quite few non-current branches accumulating , hiding them make easier search list current branch looking for. branches merged, if—and if—anoth...

java - How can I make extensions of interfaces compatible with generic parameters? -

follow this question , i'll try make self-contained. suppose have interface called animal , various reasons has generic type parameter representing implementing class: public interface animal<a extends animal<a>> i have sub-interface, dinosaur , behaves in same way: public interface dinosaur<d extends dinosaur<d>> extends animal<d> now have class lizard implements animal : public class lizard implements animal<lizard> and subclass, trex , implements dinosaur : public class trex extends lizard implements dinosaur<trex> these 4 declarations produce error. because class trex implements interface animal twice, different type parameters: since extends lizard , implements interface animal<lizard> , , since implements dinosaur<trex> , implements animal<trex> . animal<trex> not subinterface of animal<lizard> , though trex subclass of lizard , compiler error. i'm sure there's wa...

Creating random Numbers, store them in array and sort them in two listboxes c# -

i trying generate random int numbers, once generate them want store them in listbox , after sort them in second listbox . code have: int min = 0; int max = 6; // declares integer array 5 elements // , initializes of them default value // 0 int[] test2 = new int[6]; random randnum = new random(); (int = 1; < test2.length; i++) { test2[i] = randnum.next(min, max); } arraylistbox.itemssource = test2; array.sort(test2); foreach (int value in test2) { arraylistboxorder.itemssource = test2; } the itemssource needs different array - otherwise both fundamentally have same data. sort one, sort them "both". try: arraylistbox.itemssource = test2; int[] sorted = (int[])test2.clone(); array.sort(sorted); arraylistboxorder.itemssource = sorted;

python - how to get urllib2 to return data as an array -

not sure if possible, if awesome. my code is: url = "https://*mydomain*.zendesk.com/api/v2/organizations/*{id}*/tags.json" req = urllib2.request(url) password_manager = urllib2.httppasswordmgrwithdefaultrealm() password_manager.add_password(none, url, 'example@domain.com', 'password') auth_manager = urllib2.httpbasicauthhandler(password_manager) opener = urllib2.build_opener(auth_manager) urllib2.install_opener(opener) response = urllib2.urlopen(req) tagsa = response.read() print tagsa now data returned is: {"tags":[]} the api call returns following { tags: [] } however trying access list doesn't work seems treat tagsa string. treat list check if 'tags' empty. any appreciated!!! you need load json string python dictionary via json.loads() : import json ... tagsa = json.loads(response.read()) print tagsa['tags'] or, pass response json.load() (thanks @j.f. sebastian's comment): tagsa = json...

android - Are there any examples of Service which handles ACTION_RESPONSE_VIA_MESSAGE -

trying make app default sms app (as required in kitkat). instructions pretty clear, instead point: in service, include intent filter action_response_via_message ("android.intent.action.respond_via_message") schemas, sms:, smsto:, mms:, , mmsto:. service must require send_respond_via_message permission. can't understand how write service? have tried follow android sources it's still unclear. anyone can point me example how works? example of sms app register intent : protected void onhandleintent(intent intent) { if (intent != null) { if (telephonymanager.action_respond_via_message.equals(intent.getaction())) { string num = intent.getdatastring(); num = num.replace("smsto:", "").replace("sms:", ""); string msg = intent.getstringextra(intent.extra_text); // send data via intent intent intentservice = n...

sql server - How to use clustering with unique constraints in postgres? -

how can add clustered/nonclustered indexing unique constraints in postgres, equivalent script in sql server below, how can achieve postgres create table tbl1( col1 int, col2 int, col3 int, constraint uk_tbl1 unique nonclustered ( col1 asc, col2 asc )) any indexing unique constrained columns appreciated. from docs : adding unique constraint automatically create unique btree index on column or group of columns used in constraint.

c++ - How to use a stack of pointers to arrays, and access two arrays in the same command? -

just clear, homework assignment. i'm not asking me, i'm stuck on small portion of it. i'm asked implement mergesort, each new array make has placed in stack of pointers. in code below, i'm trying split array recursively, merge them together. stack named ptrs. merge() function takes 2 sorted arrays , sizes. template <typename t> t* mergesort<t>::mergesort(t arr[], int size) { int size1 = (int)size/2; int size2 = size - size1; //i'll have base case cover arrays of size 1 or 2 ptrs.push(new t[size1]); for(int = 0; < size1; i++) { ptrs.top()[i] = arr[i]; } ptrs.push(new t[size2]); for(int = 0; < size2; i++) { ptrs.top()[i] = arr[i + size1]; } return merge(mergesort(todo, size1), mergesort(ptrs.top(), size2), size1, size2); my problem marked todo. how can access first array, if second 1 on top of stack? why need stack @ all? since allocate 2 new arrays , copy 2 portions of i...

regex - Read Certain words from text file java -

so have text file ( tagged.txt ) full of different sentences. looking read text file java, , extract specific words file. e.g sentence : i went shop buy new pair of trainers if sentence has words shop , buy , or trainers in it, sentence equal opinion. i have created list of words in text file ( words.txt ), in stream against tagged.txt file. i wanted know if there way of implementing in java. read words words.txt , store in array , sort using arrays.sort(arr) . read lines tagged.txt line line , store in string . use split() split line different words , store words in array. then loop through words of line, , use array's binarysearch method search through words words array.

reporting services - SSRS - ViewMode=WebPartList performance -

i'm facing following issue regarding report manager. when access via http://myrshost/reportserver the report manager loads immediatelly. when access using following parameter http://myrshost/reportserver?viewmode=webpartlist it takes 15 seconds load. issue? thank you. i solved problem setting ip address in web service url section of reporting services configuration manager assigned (recommended).

sql server - Set local variable in rdlc expression -

is possible somehow create variable in rdlc report expression in 'online' manner? for example, have following expression: =iif(first(fields!billingaccount_billtostateprovince.value, "invoice") <> "", first(fields!billingaccount_billtostateprovince.value, "invoice") + " ", "") i suppose i'm evaluating following expression first(fields!billingaccount_billtostateprovince.value, "invoice") twice. don't , looks ugly... prefer create variable in scope of current expression , use it. is possible? as user3056839 said, welcome ssrs! anyway, want not possible since writing right not script it's expression. it's single statement returns value, cannot declare variables, use loops or part of script. you have use writing. also it's not rare see iif expression yours. 1 see iff( not null, , 'n/a'). field may evaluated twice, there's nothing can do. it's ugly it...

php returning primary key values from array -

first sorry , please gentle, learning php , sat down code basic cms practice stuck. i have site settings table contains following option | option_value | setting site_name | site name | general site_description | site description | general site_keywords | site keywords | general i doing following select "$results = select settings setting values general" my foreach loop foreach ($results $result) { var_dump($result); } i getting following results foreach loop array(3) { ["option"]=> string(16) "site_description" ["option_value"]=> string(17) "my site description " ["setting"]=> string(7) "general" } array(3) { ["option"]=> string(13) "site_keywords" ["option_value"]=> string(14) "my site keywords " ["setting"]=> string(7) "general...

android - setShowsAsAction not working below API 11 -

this code used remove menuitem : af.setshowasaction(menuitem.show_as_action_never); however, setshowsasaction requires minimum api 11 crashes on gingerbread. can use af.setvisible(false); code work on gingerbread. differences between two? same thing? use v7 support library followed: menuitem menuitem = menu.add(....); menuitemcompat.setshowasaction(menuitem , menuitemcompat.show_as_action_never);

eclipse - Signed android app crashes -

i'm tying publish app on market. after sign apk , install crash before loads activity. i've located following error in logcat 03-24 14:57:03.080: e/androidruntime(4310): java.lang.runtimeexception: unable instantiate activity componentinfo{com.golfboxdk/com.golfboxdk.loginactivity}: java.lang.classnotfoundexception: didn't find class "com.golfboxdk.loginactivity" on path: dexpathlist[[zip file "/data/app/com.golfboxdk-1.apk"],nativelibrarydirectories=[/data/app-lib/com.golfboxdk-1, /vendor/lib, /system/lib]] i've checked manifest , cant figure out whats wrong. app runs smoothly when i'm using unsigned apk. this start of manifest package="com.golfboxdk" android:versioncode="5" android:versionname="1.7.2" > <uses-sdk android:minsdkversion="9" android:targetsdkversion="17" /> <uses-permission android:name="android.permission.internet" /> <uses-permis...

c# - How do I debug an unresponsive .Net Service when "break all" does not respond? -

we have wcf service application consuming large amount of memory (see other ticket today at: server leaking memory; process looks fine ). after extensive use of windows service application @ sudden moment whole service crashes. during moment: the log (wcf-trace/server db log) display activity, no leads. the memory high, no out of memory exception server leaking memory; process looks fine number of open connections; before 'the crash': 10 - 20 memory dump shows 8 threads, without interesting stack trace. these small stacks, without user code (only calls in microsoft-symbols ) can do: attach remote debugger; connect port wcf listing to; can't do: remote debugger; break not respond attach scitechmemoryprofiler (exception: 0x80007002 ) response call of wcf; the memory still in use, server unresponsive. thanks reading ticket. we found solution. analyzed dump file windebug , , found single function in dump. don't know if luck o...

ios - AFNetworking and -[__NSCFBoolean length]: unrecognized selector sent to instance 0x1f54358 -

i have days strange problem 2014-03-24 16:50:56.097 myapp[1610:4703] -[__nscfboolean length]: unrecognized selector sent instance 0x1f54358 . i have debugging library, static library package .framework , distribute developers. debugging little hard, in point of breakpoints, have added static library .xcodeproj file sample client application , tried work it. after research , trying figure out occur have no other reason believe it's afnetworking problem! i have code in static library: edited: // selector parameter (nsdata *)thedata nsmutableurlrequest *arequest = [[[nsmutableurlrequest alloc] initwithurl:theurl cachepolicy:nsurlrequestuseprotocolcachepolicy timeoutinterval:10.0f] autorelease]; [arequest sethttpmethod:@"post"]; [arequest setvalue:key forhttpheaderfield:@"custom-header"]; [arequest setvalue:@"plain/text" forh...

java - Apply styles to text in a string Android -

i'm trying create string spannablestring apply colors , bold text. spannable wordtospan = new spannablestring("salida de la capilla de maría auxiliadora\n00:00\nmarquesa de sales\n00:00\nespíritu santo\n00:00\nsagasta\n00:00\npza. meneses\n00:00\npozo nuevo\n00:00\npza. ayuntamiento\n00:00\nsan miguel\n00:00\nestación de penitencia, iglesia san miguel\n00:00\nÁnimas\n00:00\nmariano hernández\n00:00\neduardo dato\n00:00\nrojas marcos\n00:00\npza. meneses\n00:00\ncarrera\n00:00\ncalzadilla\n00:00\ngregorio maría ferro\n00:00\nmaría auxiliadora\n00:00\nmarquesa de sales\n00:00\nentrada al templo\n00:00\n"); tv.settext(wordtospan); to speed work trying create condition this: if(wordtospan.tostring().contains(":")){ // found text string ":" (00:00) wordtospan.setspan(new foregroundcolorspan(color.rgb(140, 117, 189)), 42, 47, spannable.span_exclusive_exclusive); wordtospan.setspan(new stylespan(typeface.bold), 42,47, 47); }else{ //not found ...

Preventing empty app process under Android -

i porting existing windows 8 / ios app android. of course, want re-use of program logic / control flow possible. unfortunately, android has strange concept of activities. (i use 1 single activity because app game.) the problem have following: static variables not bound activity lifetime process lifetime. my activity can destroyed while process still alive. (be through configuration change or due low memory) but have sure newly created activity gets "fresh" static variables. i solve problem preventing activity restarts due configuration changes (that's fine because not use layouts or size-dependent resources) and @ same time assuring when activity destroyed (e.g. user switches app, memory low), whole process destroyed, too. the later 1 question: how make sure app process killed whenever there no activities alive? (in understanding, not impossible, unfortunately, empty processes exist)

java - Android - Listview with custom CursorAdapter, which running asynctask crashes -

what i'm trying using custom cursoradapter, in order choose layout show , populate view items such textviews , imageview. now not in listview items there gonna image. my cursoradapter code - private static class viewholder { textview mesg; textview mesg2; textview send; imageview myimage; } public class chatcursoradapter extends cursoradapter implements onclicklistener { public chatcursoradapter(context context, cursor c) { super(context, c, 0); } @override public int getcount() { return getcursor() == null ? 0 : super.getcount(); } @override public int getviewtypecount() { return 2; } @override public int getitemviewtype(int _position) { cursor cursor = (cursor) getitem(_position); return getitemviewtype(cursor); } private int getitemviewtype(cursor cursor) { string sender = cursor.getstring(2); string saveuser = user; ...