Posts

Showing posts from March, 2012

ios - Git clone error in Xcode -

up until i've been using xcode subversion code repositories no problem. i'm working on project uses git repository stored @ github, figured i'd go clone repository local machine , started. in xcode, add repository tell clone -- machine chews on while, , if use finder can see files being placed in target directory (which newly-created, empty directory on system). after while though, error message: fatal: destination path '/users/myname/documents/projectname' exists , not empty directory. i have tried 3 times now, each time starting empty target directory, , gives same error message each time, know has doing wrong, or have not set properly. thinking perhaps going wrong , system trying second clone operation (to non-empty directory) tried canceling , trying build, files missing project -- not of made down system. my searches on issue turn several hits people doing clone via command line , showing error message, not through xcode interface. does have su

tdd - iOS OCMock: Text Files -

i have .txt file i'd unit test. there way ocmock make "fake" test files testing purposes? behavior of application depends on whats in text file , ideally i'd write unit test different variations of text file test make sure works in cases. text file has fixed name , file path.

Python: Changing the conditions of a 'for' loop -

i attempting loop through set of points, , if conditions met, add in point inbetween current point , next one. want start loop again, running on both old , new points. example: for in range(3) if i doesn't meet set of conditions, add in new point after i .this change range range(4) . end loop, , restart for in range(4) . if meet conditions, continue in range(3) . if i reaches end without having add in new point, exit loop , continue rest of code. i have tried variety of methods, can't work. understanding along lines of: b = 3 in range(b): if (i meets conditions): pass else: b = b+1 "retry entire loop new b" i have tried using while loop, can't see how start again @ first point, should new point added in. i might missing simple, can't see solution this. thanks help! you'll need use recursive function this: def func(l): i, el in enumerate(l): if (el match conditions):

Windows installer strange custom actions -

i'm exploring msi custom-actions, i'm using orca see actual msis contains. i found in 1 msi following action types example : 3073 , 1537 , many other customaction s types couldn't find resource have full index various types. is there example way can create customized customaction types, or maybe new version of windows installer customactions not documented yet ? read custom action types , adjacent topics. 3073 = 2048 | 1024 | 1 1= dll file stored in binary table stream. 1024 = msidbcustomactiontypeinscript queues execution @ scheduled point within script. flag designates deferred execution custom action. 2048 = msidbcustomactiontypenoimpersonate queues execution @ scheduled point within script. executes no user impersonation. runs in system context.

javascript - Textarea of TinyMCE(Rich text editor lib) doesn't show anything -

i confuse how mistake using tinymce. first download http://www.tinymce.com/download/download.php choose tinymce 4.0.3. when finish download have folder tinymce_4.0.3 has folder tinymce_4.0.3\tinymce\js\tinymce copy folder (js/tinymce) website in folder mywebsite. atlast create test.php file code (i cody http://www.tinymce.com/tryit/full.php ) <html> <head> <script type="text/javascript" src="js/tinymce/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ selector: "textarea", theme: "modern", plugins: [ "advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "insertdatetime media nonbreaking save table contextmenu directionality", "emoticons template paste textcolor moxiemanager" ], toolbar1: "

android - Button with more touchable area -

Image
implemented clear button edittext according this . button small , hard touched. how make button's touchable area bigger? 1) can use touch delegate android developer documentation 2) or put button in separate linearlayout wraps content appropriate padding according size of clickable area want , set clickable button inside parameter.

c# - How to properly embed settings file -

i have settings.settings file contains number of different endpoints in it. want embed file .dll file users cannot view or modify endpoints. under build action option settings.settings file see embedded resource . read through msdn page here , i'm still not entirely sure option want. can confirm want to, , if not, option should select? i use embedded build action storing word doc template, don't see why couldn't use else such xml file contains settings. set build action embedded , can reference such: var template = "filename.xml" // <-- file mark embedded assembly loader = assembly.getexecutingassembly(); var rawstream = loader.getmanifestresourcestream(template); byte[] bytearray = rawstream.readtoend(); you need using statement: using system.reflection;

Regex with grep - match unknown number of alphabetical characters? -

i searching like: stringone_****_******_stringtwo where know stringone , stringtwo. * reflect unknown number of letters (capital), however. i had been under assumption grep -nr "stringone_\w+_\w+_stringtwo" . would work, not finding matches. how can formulate regex correctly (using grep in cygwin)? have @ manual. without -e flag, grep assumes "basic" regular expressions. in case meta-characters lose special meaning, unless escape them. do grep -nr "stringone_\w\+_\w\+_stringtwo" or grep -nre "stringone_\w+_\w+_stringtwo" or, since want uppercase letters: grep -nr "stringone_[a-z]\+_[a-z]\+_stringtwo" grep -nre "stringone_[a-z]+_[a-z]+_stringtwo" otherwise, strings 3 or more components in middle accepted.

asp classic - Would like SQL query that pulls the last 7 days of table data with ASP -

so i'm trying pull last 7 days of table data using sql within asp. think syntax incorrect <% set rstest = server.createobject("adodb.recordset") sql = "select * divisionnew jms_updatetime between '" & date & "' , '" & date 7 & "'" rstest.open sql, db %> select * divisionnew jms_updatetime >= getdate()-7 or select * divisionnew jms_updatetime >= dateadd(d,-7,getdate()) but if want absolute date (without caring time: select * divisionnew jms_updatetime >= convert(datetime,convert(varchar,getdate())) - 7 or select * divisionnew jms_updatetime >= dateadd(d,-7,convert(datetime,convert(varchar,getdate()))) if on sql server 2008 or later: select * divisionnew jms_updatetime >= convert(date,getdate()) - 7 or select * divisionnew jms_updatetime >= dateadd(d,-7,convert(date,getdate()))

xcode - How do I log a url with NSlog -

currently trying log url using breakpoint in xcode. it's printing out log message , memory address. log actual url , not memory address. question: correct way log url in xcode using breakpoints? i think mean like: nslog( @"url %@", [yoururl absolutestring]);

java - Netbeans project still running when using `Runtime.getRuntime().exec("explorer.exe");` -

i'm working on (non-malicious) screen-locking sort of swing application, , i've adapted code martijn courteaux's answer @ use java lock screen this. problem when use runtime.getruntime().exec("explorer.exe"); reopen explorer process @ program closing, netbeans thinks project still running because resulting explorer.exe running. cmd prompt , jcreator don't have issue. can give example of preferred way call command explorer.exe avoid happening netbeans? edit: close explorer process @ start of program (which includes taskbar). when run explorer, it's not open windows explorer window (which works totally fine given answers) restore regular windows ui. the problem runtime@exec waiting child process exit. default behavior. if want execute parentless process (a process in parent process can terminate though child still running), need little more creative. we use... "cmd /c start /b /normal " + yourcommand i highlight re

Error inconsistent accessibility method C# -

get message: "error 1 inconsistent accessibility: parameter type 'assignment_5.address' less accessible method 'assignment_5.contactmanager.addcontact(string, string, assignment_5.address)' c:\users\oscarisacson\documents\visual studio 2012\projects\assignment 5\assignment 5\contactfiles\contactmanager.cs 24 21 assignment 5 " this method code(all classes public): private list<contact> m_contactregistry; public bool addcontact(string firstname, string lastname, address adressin) { contact contactin = new contact(firstname, lastname, adressin); m_contactregistry.add(contactin); return true; } public bool addcontact(contact contactin) { m_contactregistry.add(contactin); return true; } and address class: namespace assignment_5 { public class address { private string m_street; private string m_zipcode; private string m_city;

Mandrill Inbound Email routing -

having bit of conceptual issue here: using mandrill sending email - ok. configured mandrill receiving email. documentation states incoming messages posted url. means such page should exist , parse messages. ideally incoming messages should end in inbox. how can accomplished? do have make changes @ dns level route inbound email smtp mail server? mandrill's incoming features optional. unless application needs programmatically process incoming mail (e.g. post-by-email blogging platform), and can't without using mandrill, can pretend mandrill's inbound features don't exist. if need plain old incoming mail, configure mx record usual. even if need use mandrill's inbound features, that's best done on subdomain. quote the docs : all email sent domain sent mandrill instead of traditional email inboxes, it's idea use subdomain, "inbound.yourdomain.com" doesn't exist.

ajax - Breeze.js: Handling empty results -

let's have detail page items: /items/{id}. user can of course try random id, if doesn't have access item, return detail page no data, not nice. i'd rather return 404 or 204 instead. however, breeze web api, i'm returning iqueryable, can't return error, , i'd have handle empty set on client. nicest way doing this? i'm thinking of checking if result empty , redirecting custom 404 page, wondering if there's better way? thanks when write service/web api controller method returns iqueryable, have made conscious decision http resource collection. collection may empty ... empty collection valid resource full collection. collection found , correct response 200, not 404. if you're http request specific item (eg.., had endpoint designed return single object route ~/customers/:id), returning http response status 404 makes sense. can have both kinds of endpoints if wish. breeze doesn't force iqueryable. option. can have mix of both kinds

android - How to define different dependencies for different product flavors -

i converting 1 of apps gradle , use new build flavor features have paid , free ad based flavor. i want ad based version depend on admob sdk. my build file looks this: buildscript { repositories { mavencentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' repositories { mavencentral() } android { compilesdkversion 18 buildtoolsversion "18.0.1" defaultconfig { minsdkversion 10 targetsdkversion 18 } productflavors { pro { packagename "de.janusz.journeyman.zinsrechner.pro" } free { dependencies { } } } } dependencies { compile 'com.android.support:support-v4:18.0.+' compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' compile filetree(dir: 'libs', include: '*.jar') } is there way configure depen

python - How to determine parallactic angle using pyephem -

how can determine parallactic angle of target in pyephem given fixed object , observer? i trying use pyephem create instrument simulator , need determine rate @ instrument rotator turning de-rotate field (this alt-az telescope), i'm trying determine rate of change of parallactic angle. thanks, josh

Updating (in MySQL database) Java objects with changed primary keys -

i'm sorry if title misleading. i have objects represent database entries, use reflection , annotations automatically retrieve/save objects from/to database. wondering how handle changes primary keys of objects. problem original "values" not remembered @ moment. example: @dbclass(tablename="category") public class category { @dbfield(name="caregory_name", isprimarykey = true) public string categoryname; @dbfield(name="a_value", isprimarykey = false) public double avalue; } then function datbaseoperations.sotreobject(category.class, acategoryinstance) tries create proper prepared statement , store (update) object basing on annotations. but if change categoryname field, cannot create proper sql statement ( update category set categoryname = ... <- don't remember original value) i emphasise need solution working whole reflection/annotations approach. i thinking of creating interface like: public inte

r - How to define an S4 prototype for inherited slots -

i have base class (let's call "a") representation common many other classes. therefore define other classes, such "b", contain class. i set prototype of these other classes (b) include default values slots inherited a. thought natural: setclass("a", representation(a="character")) setclass("b", contains="a", prototype(a = "hello")) but produces error: error in representation[!slots] : object of type 's4' not subsettable not sure why happens. if omit prototype can do: setclass("b", contains="a") and hack own generator function: new_b <- function(...){ obj <- new("b", ...) obj@a = "hello" obj } and create object based on prototype new_b() , that's terribly crude , ugly compared using generic generator new("b") , having prototype... you need name argument: setclass(&q

Arduino Ethernet Board R3 with WIFI -

i have been playing around arduino 2 days now, new this, have problem: wifi shield wont work arduino ethernet r3. got them sparkfun: https://www.sparkfun.com/products/11361 https://www.sparkfun.com/products/11287 and every time try run code: /* example prints wifi shield's mac address, , scans available wifi networks using wifi shield. every ten seconds, scans again. doesn't connect network, no encryption scheme specified. circuit: * wifi shield attached created 13 july 2010 dlf (metodo2 srl) modified 21 junn 2012 tom igoe , jaymes dec */ #include <spi.h> #include <wifi.h> void setup() { //initialize serial , wait port open: serial.begin(9600); while (!serial) { ; // wait serial port connect. needed leonardo } // check presence of shield: unsigned long start=millis(); while (wifi.status() == wl_no_shield) { if ((millis()-start)>30000) { serial.println("wifi shield not present"); // d

c# - Differentiating between Windows Services with the same name? -

i'm working on application interaction windows services. i'm using servicecontroller class handle interaction, i'm wondering happen if encounter 2 services same name. in sample code provided in documentation, address services name, so: foreach (servicecontroller sctemp in scservices) if (sctemp.servicename == "simple service"){ /* work */ } i don't see stipulations requiring servicename unique. if 2 services named same, yet user wishes interact 1 of them, how handle this? service names must unique, according createservice documentation : error_duplicate_service_name the display name exists in service control manager database either service name or display name.

javascript - Draggable element without JQuery -

i trying make draggable library sort of thing 1 of projects, struggling bit making elements draggable. when element touches top of container starts rebound more move mouse up, randomly gets stuck. got ideas why it's doing this, put in checks try prevent it. setdraghandlers: function(obj,objishandler,container) /* if object handler, parent thing moved */ { var tomove = (!objishandler ? obj : obj.parentnode), handlestyles, objstyles, containerstyles, objleft, objtop, objwidth, objheight, handlewidth, handleheight, containerwidth, containerheight, mousex, mousey; var movelistener = function(e) { var mousex_new = dragger.mousex(e), mousey_new = dragger.mousey(e), mousex_diff = (mousex > mousex_new ? mousex - mousex_new : mousex_new - mousex),

wpf - Same applications share the static variables when accessed through browser -

i have 2 different wpf apps...both accessed through internet explorer active ex. app1 - using dlls in c:\progfiles(86)\app1 and app2 - using dlls in c:\progfiles(86)\app2 and both have common dlls...and these dlls have static variables. when access thse static variabled 1 application (ex:app1)..and after if try access other app (ex: app2)...the first value getting used. can tell me should in case?

Hotel availability search query on MYSQL -

this question exact duplicate of: mysql query hotel availability (not calculate total price) 1 answer i having little problem calculating total price of each room hotel. for example: room_1_total 170 on each row hotel_id 1. room_2_total 170 on each row hotel_id 1. room_1_total 10 on each row hotel_id 2.(i m sure, not working) room_2_total 10 on each row hotel_id 2.(for sure, not working) and on... here code along output.. http://sqlfiddle.com/#!2/575d3/2 mysql query: db structure , dummy data... create table if not exists `omc_hotel` ( `id` int(11) not null auto_increment, `name` varchar(100) not null, primary key (`id`) )engine=innodb default charset=latin1; insert `omc_hotel` (`id`, `name`) values (1, 'hotel abc'), (2, 'hotel csb'), (3, 'hotel csd'), (4, 'hotel ndg'); create table if not exists `omc_hotel_r

Ruby Array Extension -

my prep work asking me make array extension file , add methods it. gave me: describe array describe "#sum" "has #sum method" [].should respond_to(:sum) end "should 0 empty array" [].sum.should == 0 end "should add of elements" [1,2,4].sum.should == 7 end end end so i've written this: class array def sum(array = []) add = 0 if array == [] array = add else while array.length > 0 add = add + array.last array.pop end array = add end array end end i keep getting error: array #sum has #sum method should 0 empty array should add of elements (failed - 1) failures: 1) array#sum should add of elements failure/error: [1,2,4].sum.should == 7 expected: 7 got: 0 (using ==) # ./14_array_extensions/array_extensions_spec.rb:23:in `

html - IE10 - text-align: center is aligning to the right -

i using text-align: center in div align section heading. reason in ie 9/10 aligning right. when comment out, goes being centered. in chrome/ff/safari works fine. don't have issue other sections, guessing has being nested inside div. <h3 class="sub-section-heading light teal-ts">complete ingredient list:</h3> <div id="ingredient-list"> aloe barbadensis (organic aloe) juice, </div> .sub-section-heading { font-size: 24px; text-align: center; font-family: 'pf_regular'; text-transform: uppercase; color: #000; margin-bottom: 20px; }

java - BUILD FAILED: Cannot find an environment variable -

i'm trying build tinos/rina project https://github.com/pouzinsociety/tinos/tree/development on raspbian (raspberry pi debian). its instructions issue ant jar in build directory, when get: build failed /opt/tinos/projects/rina/build-rina/build.xml:34: cannot find /opt/tinos/projects/rina/build-rina/${env.tinos_home}/projects/spring-build/tinos/package-top-level.xml imported /opt/tinos/projects/rina/build-rina/build.xml so there's environment variable i'm missing somewhere, linux environment variable, or sort of java or apache/ant variable? set it? i tried set tinos_home=/opt/tinos/ command line, didn't change anything. i'm stupid , never performed "export tinos_home" -- that's fixed (bash shell)

android - AlarmManager or Broadcast receiver battery widget -

which solution better battery widget. broadcast receiver or alarmmanager trigered every 5 minutes? that depends upon definition of "better". you cannot register action_battery_changed broadcasts manifest, have have service running all time manages dynamically-registered receiver broadcast. many users dislike this. alarmmanager avoids need continuously-running service, mean app widget lag bit on finding out of battery level changes. however, allow user control polling frequency, via sharedpreference , rather hard-coding 5 minutes. way, user in control on how cpu/battery consumed app polling, , therefore in control on how lag there be.

java - Using a nosql database for very large dataset with small data size highly written and moderate read -

what better nosql database creating system record advertisement data 50 200 millions insert per day, aggregation of data used show pattern of how users engage ads. mongodb seems major industry players picking riak job. seems mongo had flush caveats in last 2 releases , current version seems pretty job, idea? it seems mongodb hadoop ( http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-hadoop/ ) fits data requirements. can store data in mongodb , run aggregation jobs (map/reduce) on hadoop cluster.

Control loss with Javascript code -

i wrote javascript website creating , not sure why code runs automatically, 1 of solutions write function/create timer code runs @ time want to. here js: var introcap = document.getelementbyid("captioncol"); var imgdiv = document.getelementbyid("imgcol"); var introdiv = document.getelementbyid("intro"); var expose = document.getelementbyid("gotopage"); var fade = 1; var l = 15; var r = 45; //expose.onclick = move; commented out time being. function stop() { clearinterval(moveint); clearinterval(fadeint); } function fadeout() { fade -= 0.07; introdiv.style.opacity = fade; introdiv.style.filter = "alpha('"+fade+"')"; if(introdiv.style.opacity<0) { stop(); } } var fadeint = setinterval("fadeout()", 60); function move() { l -= 0.1; r += 0.1; introcap.style.left = r+"%"; imgdiv.style.left = l+"%"; if (imgdiv.s

php - Symfony2 add role after registration to user account using event_subscriber and FOSUser bundle -

working on first large symfony2 project , i'm having little trouble grasping what's going on event listener/subscribers. i want have event subscriber adds role (blog_user) fosuser entity after user registers account. here's i've got far: registration listener: namespace myblog\sitebundle\eventlistener; use fos\userbundle\fosuserevents; use fos\userbundle\event\formevent; use symfony\component\eventdispatcher\eventsubscriberinterface; class registrationlistener implements eventsubscriberinterface { public static function getsubscribedevents() { return array( fosuserevents::registration_success => 'onregistrationsuccess', ); } public function onregistrationsuccess(formevent $event){ $rolesarr = array('role_user', 'blog_user'); $user = $event->getform()->getdata(); $user->setroles($rolesarr); } } services.yml: services: myblog_user.registration_lis

windows - KeEnterGuardedRegion() vs. KeRaiseIrql(APC_LEVEL, &old_irql) -

there 2 ways disable apcs: call keenterguardedregion(); call keraiseirql(apc_level, &old_irql); what's difference? see msdn documentation titled disabling apcs : using guarded region faster raising , lowering current irql, guarded regions available in windows server 2003 , later versions of windows. so, if code needs support windows xp, use keraiseirql . if not, use keenterguardedregion .

Data import from CSV to SQL Azure Database -

i trying load csv file azure database using sql server import , export wizard. getting following error message @ "copying "dbo".mytest_table"... copying "dbo"."mytest_table" (error) messages error 0xc020844b: data flow task 1: exception has occurred during data insertion, message returned provider is: tables without clustered index not supported in version of sql server. please create clustered index , try again. (sql server import , export wizard) error 0xc0047022: data flow task 1: ssis error code dts_e_processinputfailed. processinput method on component "destination - mytest_table" (38) failed error code 0xc020844b while processing input "destination input" (41). identified component returned error processinput method. error specific component, error fatal , cause data flow task stop running. there may error messages posted before more information failure. (sql server import , e

php - Sql code for displaying one account from two relational tables -

i want display 1 account 2 relational table. example if inquire account number , enter it, details of account shown not every members. in output whole members , details inside database display. how can manage display 1 account 2 relational tables? know there wrong in sql. <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'password'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('could not connect: ' . mysql_error()); } $sql = 'select member.*, account.* member, account member.mem_id = account.mem_id'; mysql_select_db('databasename'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('could not data: ' . mysql_error()); } while($row = mysql_fetch_array($retval, mysql_assoc)) { echo "account number:{$row['account_number']} <br> ". "first name: {$row['fname']} <br> ". "last name: {$row['lname']} <br> ". &qu

c# - How to restrict user from entering specific chars (xml invalid characters) in textbox? -

i have problem textbox. user enters text/string in textbox , string exported value of attribute in xml file. there way how can disable user enter (type+paste) forbidden (for xml format) characters, symbol euro €? instead of restricting user can filter out characters don't want before passing xml. string texttopass = replaceinvalidcharacters(yourtextbox.text); public string replaceinvalidcharacters(string toreplace) { toreplace = toreplace.replace("€",""); //similarly others unwanted characters return toreplace; }

php - Make Smarty compile templates to memcache -

i have project uses smarty template engine (2.6). point can't have save files locally mean saving repository. same cache. my question - how should implement compiling templates to, example, memcache? i playing stream wrapper maybe has better solution? every repository system has means of excluding files tracking. have use, instead of reinventing square wheel

Get error "mismatched input 'as' expecting FROM near ')' in from clause" when run sql query Hadoop Java -

i created 2 tables java code tablehivecell , tablehivewifi . when try run followed sql command: select count(ues.cnc) 'active ues' ^ (select distinct cnc tablehivecell wifi union select distinct cnc tablehivecell cell) ues; i error: java.sql.sqlexception: query returned non-zero code: 11, cause: failed: parse error: line 1:22 mismatched input 'as' expecting near ')' in clause @ org.apache.hadoop.hive.jdbc.hivestatement.executequery(hivestatement.java:189). did miss something? [edit 1] i tried: select count(ues.cnc) 'active ues' ^ (select distinct cnc tablehivecell wifi) union (select distinct cnc tablehivecell cell) ues; same error [edit 2] i tried: select count(ues.cnc) active_ues (select distinct cnc tablehivecell wifi union select distinct cnc tablehivecell cell) ues; ^ get same error last as : line 1:142

Is there any difference between WPF TextBlock and TextBox? -

what criteria must consider when selecting 1 of these 2 controls? common both textblocks , textboxes: can used display text can set specific height , width or set auto grow in size text. can set font size, font type, font styling, wrap , range left, right or centred. can have opacity set , have pixel shaders applied. textblock: used displaying text more focused typographically. can contain text set different colors, fonts , sizes. the line height can increased default setting give more space between each line of text. text inside textblock cannot made selectable user. textbox: used displaying text more focused content input or when content needed made selectable user. can set 1 colour, 1 font size, 1 font type etc. have fixed line spacing. can set fixed height , width have scrollbars switched on allow content expand.

c# - How to define a public static method with a collection param in C++/CX? -

how define public static method param collection (vector or map) ? (then, need c# in wp8 call method) i wrote: public ref class testclass sealed { public: static void test(windows::foundation::collections::ivector<int> ^ s); static void test1(platform::collections::vector<int> ^ s); } then, both test , test1 compile errors. error lnk2001: unresolved external symbol "public: static void __cdecl wpruntimecomponent::delegatetest::test(struct windows::foundation::collections::ivector ^)" (?test@delegatetest@wpruntimecomponent@@saxp$aau?$ivector@h@collections@foundati‌​on@windows@@@z) there 2 problems code. the method test doesn't have body therefore linker error the method test1 public method of ref class means can use windows runtime types in signature whereas method has param of type platform::collections::vector, not proper windows runtime type, happens helper native type defined in header file

ebcdic - Issue with comp3 fields in COBOL source file -

we have used below process in loading file(with comp3 data) informatica mainframe. ftpd mainframe file in binary mode unix server imported source cobol copybook vsam file type set source file properties fixed width , codepage ibm ebcdic english ibm1047. verified usage in source comp3 relevent fields even above steps not map comp3 fields correct. when code page changed ascii map string data. could please let know missing? when code page changed ascii map string data. that's because character encoding only applies string data. bytes of data such 'packed' bytes or binary data bytes have no meaning after being converted different character encoding unless first converted character representations. what platform running cobol? in cobol, meanings of various "comp" data types change depending on hardware platform , potentially os. (i suppose specific compiler though don't know of examples.) without knowing how specific cobol maps data typ

Is there a way that I can use a <select> to order rows in AngularJS -

i have rows returned database , displayed on screen: <tr data-ng-repeat="row in grid.data"> the rows have columns "id", "number", "text" etc. has examples of how create drop down allow me select of these 3 columns order returned rows by? this quite simple, try: html : <body ng-controller="appctrl"> sort by: <select ng-model="sortfield" ng-options="o.label o in fields"></select> <label> <input type="checkbox" ng-model="inverse"> inverse </label> <hr> <table> <tr data-ng-repeat="row in grid.data|orderby:sortfield.key:inverse"> <td>{{row.id}}</td> <td>{{row.number}}</td> <td>{{row.text}}</td> </tr> </table> </body> js : app.controller('appctrl', ['$scope', function($scope) { $scope.fields

python - Writing an If condition to filter out the first word -

i have string: father ate banana , slept on feather part of code shown below: ... if word.endswith(('ther')): print word this prints feather , father but want modify if condition doesn't apply search first word of sentence. result should print feather . i tried having and didn't work: ... if word.endswith(('ther')) , word[0].endswith(('ther')): print word this doesn't work. help you can use range skip first word , apply endswith() function rest of words, like: s = 'father ate banana , slept on feather' [w w in s.split()[1:] if w.endswith('ther')]

loops - MATLAB: Faster pre-allocation of zeros-matrix -

this question has answer here: faster way initialize arrays via empty matrix multiplication? (matlab) 5 answers /edit : see here interesting discussion of topic. @dan using a(m,n) = 0 appears faster, depending of size of matrix a , a = zeros(m,n) . both variants same when comes pre-allocation before loop? they definately not same. though there ways beat performance of a=zeros(m,n) , doing a(m,n) = 0 not safe way it. if entries in a exist keep existing. see this nice options, consider doing loop backwards if don't mind risk.

How do I apply the default theming to views in an android IME? -

i experimenting own android input method, @ moment having trouble styling / theming. problem following: the view inflate , return in oncreateinputview contains plain android buttons. can listen onclick events on these buttons , works fine, when click buttons, looks don't change, meaning don't change background color etc. normal android buttons do. i can, however, apply custom background xml containing selector: styles.xml: <style name="categorybutton"> <item name="android:background">@drawable/button</item> </style> button.xml: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/button_pressed" android:state_pressed="true"></item> <item android:drawable="@drawable/button_normal"></item> </selector> this works

xcode - linking dictionary to custom initialiser terminating - reason: '-[__NSCFArray isFileURL]: -

please patient im nuubie @ i'm writing custom init first time, sentance01text loads fine know plist reading ok :) cant seem sentance01timing timings work >< this method should pass sentance01timing typed user objectforkey should load relevant array audiointervals array at moment i'm using nsstring access dictionary , pass array audiointervals seems wrong , causes error anyhelp appreciated. dont understand why worked text not this? terminating - reason: '-[__nscfarray isfileurl]: probably im doing dumb >< please if can ps having use old mac (my nice 1 being repaired @ moment - using non arc - updating code when nice mac back, keep in mind why im not releasing objects @ moment...) helloworld.m #import "helloworldlayer.h" #import "textwithaudiohilight.h" @implementation helloworldlayer +(ccscene *) scene { ccscene *scene = [ccscene node]; helloworldlayer *layer = [helloworldlayer node]; [scene addchild: layer]; return scene

android - Google+ sign in: PlusClient VS AccountManager -

i building android application needs google+ sign in functionality. needed identify user , access user's friends/contacts in google+. can see 2 options build login flow: using android.accounts.accountmanager or using com.google.android.gms.plus.plusclient. which 1 preferred approach execute single-button-click login? com.google.android.gms.plus.plusclient recommended approach: according google if planning provide “sign-in google” feature, recommend using google+ sign-in, provides oauth 2.0 authentication mechanism along additional access google desktop , mobile features.

php - need to redirect url without using the function header -

i need redirect page another, can't use header function, there other way it? what need this: if (test){ ---do something--- redirect } else { return false } thanks if (test){ ---do something--- die("<script>location.href = 'http://www.google.com'</script>"); } else { return false; }

node.js - Set CSS path for Jade layouts -

i'd set css path in express application in order use 1 in jade layouts. however, don't know how do, try use "app.set('csspath', __dirname+'/public/admin/css/')" doesn't work because can not use "app.get()" in external controllers. my layout _layout.jade : !!! 5 html(lang='fr') head meta(charset='utf-8') link(href='admin/css/screen.css', media='screen, projection', rel='stylesheet', type='text/css') body .container h1 wellcome forest administrator .space20 block content .clear.space20 script(type='text/javascript', src='admin/js/jquery.js') my page edit.jade : extends ../_layout block content .block.half.first h2 add post and i'd use : link(href='+mycsspath+', media='screen, projection', rel='stylesheet', type='text/css') not sure if want can use res.locals.csspath =

Android Application for Registration to a website -

i have build android application. have convey single purpose. there website called www.graffititechnologies.com . have create app register above mentioned website. beginner in android. how possible. create web service on server of website! post values cellphone app server's database calling these web services , passing data through them. tutorial: http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/ kindly mark answer if helped :)

treeview - right click menu option in the tree root node -

i want right click menu option in tree root node(javafx). 1 me on this. treeitem<string> root = new treeitem<>(""+selecteddirectory); root.setexpanded(true); locationtreeview.setroot(root); root.getchildren().addall( new treeitem<>("item 1"), new treeitem<>("item 2"), new treeitem<>("item 3") ); you can perform desired behaviour in 2 steps: defining custom treecell factory on treeview ; attaching context menu on treecell of root tree item. the following code defines custom treecell factory: // defines custom tree cell factory tree view tree.setcellfactory(new callback<treeview<string>, treecell<string>>() { @override public treecell<string> call(treeview<string> arg0) { // custom tree cell defines context menu root tree item return new mytreecell(); } }); and, here implementation of custom tree cell attaches context

functional programming - Can't output from .hs to .hc with GHC in Haskell -

i intrigued when heard ghc can output file c . the glasgow haskell compiler (ghc) compiles native code on number of different architectures—as ansi c—using c-- intermediate language. so installed haskell platform , created simple .hs file. main = putstrln "hello, world!" and according manual. -c stop after generating c (.hc file) now run command. ghc -c test.hs but doesn't create .hc file, nor stop mid-compilation. $ ls test.exe test.hi test.hs test.o if want understand how haskell programs execute @ low level, best study core instead ( -ddump-simpl ). after point code becomes hard read experts. main reason ghc's stack , heap management gets hard-coded. result, low-level generated haskell code giant mess of tiny procedures, doing complex pointer arithmetic before finishing indirect jumps unknown locations. worst kind of spaghetti code. to provide of actual answer - could generate c going on llvm backend: ghc -ddump-llvm -

java - What is wrong with this cycle. HSSF -

Image
in code i'm searching list of lists element, contains in list. why when found needed elements, it's starting work bad. if find element, contains in list, cell should fill in blue color, not happens. hssfworkbook workbook = new hssfworkbook(file); creationhelper createhelper = workbook.getcreationhelper(); //get first sheet workbook hssfsheet sheet = workbook.getsheetat(0); cellstyle style = workbook.createcellstyle(); style.setfillforegroundcolor(indexedcolors.lime.getindex()); style.setfillpattern(cellstyle.solid_foreground); cellstyle style2 = workbook.createcellstyle(); style2.setfillforegroundcolor(indexedcolors.red.getindex()); style2.setfillpattern(cellstyle.solid_foreground); cellstyle style3 = workbook.createcellstyle(); style3.setfillforegroundcolor(indexedcolors.blue.getindex()); style3.setfillpattern(cellstyle.solid_foreground); (int i=0;i<listoflist.size(

File upload works during debugging but not on the actual run in c# -

while debugging, below code works. when trial run of test displays error. combat error, i've added java script ( example question) change opacity, doesn't seem trick. upload part of code: //file details filename = "emed.pdf"; filepath = "\\\\iasfs1\\qa\\openspace\\automation\\filesforupload\\emed.pdf"; //file upload waitforelementpresent(by.id("upload")); ijavascriptexecutor js = (ijavascriptexecutor)driver; js.executescript("document.getelementbyid('fileupload').style.opacity = 1;");'' iwebelement fileupload = driver.findelement(by.id("fileupload")); console.write("fileupload.displayed : " + fileupload.displayed.tostring()); debug.writeline("fileupload.displayed : " + fileupload.displayed.tostring()); system.diagnostics.trace.writeline("fileupload.displayed : " + fileupload.displayed.tostring()); fileupload.sendkeys(osdata.filepath);' error displayed m

c# - When are Property Imports Satisfied? -

when property imports satisfied? thought satisfied before constructor, properties initialized before constructor runs, following example shows importedclass null in constructor. i know can resolve using importingconstuctor; sake of understanding when property imports satisfied. public myclass { [import] public importedclass importedclass {get;set;} public myclass() { //imported class null @ point, nothing can done here. } } an object cannot manipulated before constructor being called. mef provides solution problem though, interface called ipartimportssatisfiednotification public myclass : ipartimportssatisfiednotification { [import] public importedclass importedclass {get;set;} public myclass() { //imported class null @ point, nothing can done here. } public void onimportssatisfied() { //importedclass set @ point. } } about actions mef takes set imports; first calls constructor, sets properties, calls notification me

sql - How to select an "AS field" in MySql? -

i have query separated in different parts. (distance, score , rank) select entry.*, address.*, (6367.41 * sqrt(2 * (1-cos(radians(entry.latitude)) * cos(0.92640848333131) * (sin(radians(entry.longitude)) * sin(0.15361853481704) + cos(radians(entry.longitude)) * cos(0.15361853481704)) - sin(radians(entry.latitude)) * sin(0.92640848333131)))) distance, (case when `entry`.`title` '%%' 50 else 0 end + case when `entry`.`description` '%%' 30 else 0 end + case when `entry`.`description_long` '%%' 10 else 0 end + case when `entry`.`product_type` = 1 0 else 0 end + case when `entry`.`product_type` = 2 40 else 0 end + case when `entry`.`product_type` = 3 50 else 0 end ) score, (case when (score > 100 , distance <= 10) 1 else 0 end) rank `usr_web12_1`.`entries` `entry` inner join `usr_web12_1`.`entrieslocations` `entrieslocation` on (`entry`.`id` = `entrieslocation`.`entry_id`) inner join `usr_web12_1`.`addresses` `address` on (`address`.`id`

ios - Why NSLineBreakByWordWrapping splits word? -

with using nsattributedstring, tried create text inside triangle below; http://postimg.org/image/rp9fukgaj/ i used "nslinebreakbywordwrapping" method fitting text inside defined shape. first word of text splits , couldn't found solution that. want text jumps following line instead of splitting. how can that? below code used; - (void)viewdidload { [super viewdidload]; self.view.backgroundcolor=[uicolor blackcolor]; ctfontref fontref = ctfontcreatewithname((cfstringref)@"helveticaneue-regular", 15.0f, null); nsmutableparagraphstyle* paragraph = [nsmutableparagraphstyle new]; paragraph.headindent = 10; paragraph.firstlineheadindent = 10; paragraph.tailindent = -10; paragraph.linebreakmode = nslinebreakbywordwrapping; paragraph.alignment = nstextalignmentcenter; paragraph.paragraphspacing = 15; nsdictionary *attrdictionary = [nsdictionary dictionarywithobjectsandkeys: (__bridge id)fontref, (nsstring *)

version control - I want to commit but also create branch in git. Is this the correct way? -

i have 3 files unstaged. want commit , push 2 of them , save 3rd in private branch. if git add/git commit 2 of them, git checkout branch name , git checkout master , git pull followed git push correct? for concreteness, on master , , have 3 files: .../file1 .../file2 .../file3 where ... parts path within repo, , i'll leave them out below. the first 2 files new (you created them) or existing (you modified them), doesn't matter in case. meanwhile file3 either new or modified, may make difference below. the first part right: git add file1 file2; git commit make new commit containing 2 new-or-modified files (and other files in repo), not containing file3 (if it's new), or not containing changes file3 (if exists). as commit file1 , file2 done, can push new master : git push origin master it doesn't matter have not done file3 yet, or branch on when above; specifying want push local branch master origin 's master , can @ least try