Posts

Showing posts from June, 2013

windows - Clang's equivalent to GCC's -mwindows -

i know how instruct gcc (using the -mwindows flag ) generate pe using image_subsystem_windows_gui instead of image_subsystem_windows_cui windows subsystem . does clang offer equivalent flag? if not, how can change generated executable's windows subsystem (preferable using open source software)? try with -wl,--subsystem,windows there native , console , posix available use.

php - convert a string into array and get values from that array -

i stored array {"10":"10","14":"14","16":"16","25":"25"} string in data base, right tried number above string. tried explode , str_replace can't data, can please me. this json object have decode json_decode , take values array_values : $values = array_values(json_decode($string, true));

html - IMG in <li> to dynamically scale down as the browser window and/or screen resolution is smaller? -

i have logo in navbar, want resize automatically screen sixe/resolution changes. please see code below: tried img css, doesn't seem work. img { max-width: 100%; height: auto; width: auto\9; /* ie8 */ } <ul class="s5_1"> <div> <li>img src="assets/img/logoonly.jpg"></li> </div> <br/> <br/> <br/> <br/> <br/> <ul style="float:right;list-style-type:none;"> <li><a class="active style2" href="index.html">home |</a></li> <li><a href="about.html"> | </a></li> <li><a href="vission.html"> vision | </a></li> <li class="dropdown"> <a href="#" class="dropbtn"> products | </a>

Crystal Reports: why is memo-type field truncated at 255 characters? -

i'm working in crystal reports xi (11.5.12.1838) running on remote windows system , accessed via citrix. data coming blackbaud raiser's edge export. i have 2 different custom reports need display note (from raiser's edge) can of length. in both cases, database line dragged , dropped field in report. it's set grow no maximum. in 1 report, works; in other, not, truncates text @ 255 characters (or perhaps bytes: rtf version cut off earlier in text). the criteria reports different (one reporting on single constituent, other [which doesn't work] on constituents connected specific individual). however, don't know enough might cause problem narrow down aspects of report configuration need adjustment. any ideas? i'll note in broken report field grows correctly , type 'memo' -- grows enough hold 255 characters , stops. edit: no, formula fields aren't involved. can't split string in database. edit 2: thank suggestions. database up-to-date

c++ - Error is generated with the sort method while sorting the values inside a vector -

when compiling below code using g++ in debian machine, following errors generated...can pls me why error are? tried commenting sort line error dissappears our task requires sorting done can possible solution code: #include <iostream> #include <vector> #include <algorithm> using namespace std; // here simple struct struct mystruct { int num; // define operator < bool operator <(const mystruct& rhs) { return (num < rhs.num); } }; int main() { vector<mystruct> myvector; // let size 5. myvector.resize(5); // push 5 instances of mystruct num ranging // 5 1 mystruct teststruct; int = 0; (i = 0; < 5; ++i) { teststruct.num = 5 - i; myvector[i] = teststruct; } // sort vector sort(myvector.begin(), myvector.end()); // try display num each element. sorted (i = 0; < 5; ++i) { cout << myvector[i].num << '\n'; } return 0; } output

python - Not getting Exact result in pandas -

df=pandas.dataframe(processed_data_format, columns=["file_name", "innings", "over","ball", "individual ball", "runs","batsman", "wicket_status","bowler_name","fielder_name"]) = {'runs':['sum'],'ball':['sum'],'file_name':['unique']} t = df.groupby('batsman').agg(a) after running code getting result like ['younis khan', array(['225245', '225247'], dtype=object), 113, 121] but result like ['younis khan', 2 , 113, 121] instead of array(['225245', '225247'], dtype=object) need count of file name

php - How to echo JSON doubly nested object literal w/ proper "headers" -

Image
i'm trying echo json object literal includes every row in database table. as standard methods found in many other similar questions looked at, i'm fetching every row , encoding so: $con=mysqli_connect("localhost","username","pass","markers");//markers db table name $result = mysqli_query($con,"select * markers"); $rows = array(); while($r = mysqli_fetch_array($result)) { $rows[] = $r //or: $rows[] = array('data' => $r); } echo json_encode($rows); similarly question php: can't encode json multiple rows or mysql table json , i want echo json object looks this: { "data1": // how "data1"? { name: john smith, title: mr, description: man } } { "data2":{ // how "data2"? name:bob smith, title: mr, description: guy } } exc

sql server - incorrect syntax near the keyword where c#? -

when run code erorr apeared incorrect syntax near keyword c# public sqldatareader getdr(commandtype handelmode, string sqlstat, list<sqlparameter> parms) { sqldatareader r = null; sqlcommand com = new sqlcommand(); sqlconnection con = getconn(); try { com.commandtext = sqlstat; com.connection = con; com.commandtype = handelmode; if (parms != null) { foreach (sqlparameter p in parms) { com.parameters.add(p); } } r = com.executereader(commandbehavior.closeconnection); } catch (exception ex) { messagebox.show(ex.message, "error", messageboxbuttons.ok); return null; } { con.close(); } return r; } private void picturebox10_click_2(object sender, eventargs e) { list<sqlparameter> parslist = new list<sqlparameter>(); string selectstatement = "select id,anam

git - Diff & Merging between different VCS -

Image
i transferring old svn repository git. of folders in svn-repo transferred new git repository, success. my team still building on svn repo, , i'm working on git repository. because structure on new repo (git) totally different (new folders, ect.) it's hard merge through tower (mac app). is there way can use git merge folders? example directory structure; folder1 git repository folder2 folder outside csv example script; $ diff_merge.sh folder1/ folder2/ i've been searching this, couldn't come relative easy solution. ironically, there free, platform-independent tool called shell script envisioned - diffmerge - can that. it's not linked version control system can diff , merge entire folder trees like. use quite such tasks. here . screen shot of folder diff ui (on windows): screen shot of file diff ui (on mac): screen shot of file merge ui (on linux):

asp.net - ReportViewer and font-family -

i implemented web-portal in .net integrate reportviewer control load ssrs reports. in order customize reports use own font in rdl report file. font dynamically loaded on client side font-family declaration in css it: @font-face{ font-family: 'helvetica 35 thin'; src:url('../fonts/helvneue35_w1g.eot?#iefix'); src:url('../fonts/helvneue35_w1g.eot?#iefix') format('eot'), url('../fonts/helvneue35_w1g.woff2') format('woff2'), url('../fonts/helvneue35_w1g.woff') format('woff'), url('../fonts/helvneue35_w1g.ttf') format('truetype'), url('../fonts/helvneue35_w1g.svg') format('svg'); } all work perfectily on localy visual studio iis express : font it's correctly loaded on each web browser , correctly displayed in report. works on development server. sincei deployed on integration server, font not displayed. specify use same ssrs server on local visual , on integration platform. i inve

appcelerator - How much legacy Objective-C code can Hyperloop work with? -

hyperloop looks exciting way forward appcelerator. i've read basic hyperloop docs , watched intro video. in intro video can see simple swift or objective-c files can used, i'm interested find out how of exisiting swift/objective-c codebase dropped hyperloop project? example, take entire project written in swift/objective-c , work on using hyperloop? does have hands on experience? cheers! you can potentially use lot of code can't (today) drop in full xcodeproject without bit of work. if @ example ios project comes alongside hyperloop ( http://labs.appcelerator.com/project/55f74a9f421c44837717716b/hyperloop-module ) can see drop in examples of both swift , objective-c code.

python - Django JSON response error status -

my api returning json object on error status code http 200 : response = jsonresponse({'status': 'false', 'message': message}) return response how can change response code indicate error? jsonresponse returns http 200 , status code 'ok' . in order indicate error, can add http status code jsonresponse subclass of httpresponse : response = jsonresponse({'status':'false','message':message}, status=500)

Html To Image Using NReco.ImageGenerator : C# -

introduction i working functionality can convert "html" image.for image creation, use "image" function(of system.drawing). functionality working fine(including html styles etc) except 1 thing describe later in problem. problem problem appears when using non-english language in html, although english works fine.obviously unicode problem, doing wrong due limited understanding. string str ="<p> have day !!</p>"; //output : have day !! string str2 = "<p>قطعا</p>"; //output : non-sense symbols omega c# code var html = string.format("<h1>فقط</h1><p>قطعا</p>"); var htmltoimageconv = new nreco.imagegenerator.htmltoimageconverter(); var jpegbytes = htmltoimageconv.generateimage(html,imageformat.png.tostring()); memorystream memstr = new memorystream(jpegbytes); system.drawing.image img = system.drawing.image.fromstream(memstr,true,true); img.save(server.mappath("~/

jquery - How to set Axis step range in Google Chart? -

hello want create google chart getting problem ticks: add [0, -50000, -100000, -150000, -200000] ... it's working fine add range 500000 , set auto ticks... in advance. google.load('visualization', '1', {packages: ['corechart', 'line']}); google.setonloadcallback(drawbackgroundcolor); function drawbackgroundcolor() { var data = new google.visualization.datatable(); var amount_array = []; //data.addcolumn('number', 'dogs'); data.addcolumn('date', 'product'); data.addcolumn('number', 'amount'); data.addrows([ [ new date(2015,4,20),-199525], [ new date(2015,4,27),-195930], [ new date(2015,5,17),-175720], [ new date(2015,7,05),-189725], [ new date(2015,8,11),-174875], [ new date(2015,8,30),-170819], [ new date(2015,9,07),-176488], [ new date(2015,9,21),-188950],

java - Appreciation about Pcap devices -

i'm trying automatically active device on system. for example: my pc has 2 devices. 1. tap-windows adapter v9 2. intel(r) ethernet connection actually active device intel connection. so want application can automatically use active device dump pcap. my idea search subnetmask in both devices. active device has inet4 ip mask=[inet4: 255.255.255.0]. deactive 1 gives me this: mask=[0] is right thinking, active device never gets mask of 0? this extends broadcast. here implementation: static public pcapif selectactivedev(list alldevs){ pcapif device = new pcapif(); for(int = 0; a<=alldevs.size()-1; a++){ if(alldevs.get(a).getaddresses().get(0).getnetmask().tostring() != "0"){ device = alldevs.get(a); } } return device; } i'm using jnetpcap 1.3.0 eclipse. :)

Java / Eclipse profiling: Is there a way to show the number of method calls to each method? -

i'm debugging applications lacks performance in 1 situation, expanding tree node in custom tree visualizing control, , our assumption is due recursive calculation tree values. now idea trace number of calls each method identify methods uncommonly called, may give more insight performance issue. is there built in profiler in eclipse / other way trace number of method calls (without or preferable summed run time within each method)? the visualvm cpu profiler can : https://visualvm.java.net/profiler.html .

Using putty to shutdown linux in c# -

i encountered problems during writing application shutdown/restart linux windows in c#. i'm trying use putty task, wrong. process p = new process(); processstartinfo info = new processstartinfo(); info.filename = "putty.exe"; info.redirectstandardinput = true; info.useshellexecute = false; info.arguments = @"root@192.168.0.25 -pw 1234qwer "; p.startinfo = info; p.start(); p.standardinput.writeline("shutdown -h "); p.standardinput.writeline("exit"); string output = p.standardoutput.readtoend(); p.waitforexit(); console.writeline(output); above i've pasted code i've used achieve goal. fine till have write more in putty command line, in case standardinput not way , didn't find other way this. i tried use plink.exe in same way didn't solve problems - in fact plink

scala - Why selenium "wait" is not consistent? -

i have webelement (text field) i'm watching wait , because want send keys it. tt looks this: val wait: webdriverwait = new webdriverwait(driver, 120) wait.until(expectedconditions.elementtobeclickable(by.id("invoice_supplier_name"))) val suppliertextfield: webelement = driver.findelement(by.id("invoice_supplier_name")) suppliertextfield.clear() suppliertextfield.sendkeys(invoice.suppliername) but it's ok , error "element not visible" does know why be? thanks

Spring Batch - Issue with PageSize in JdbcPagingItemReader -

hi working on spring batch, processes skus in sku table , send request inventory system inventory details. send invetory details need send 100 ski ids @ time have set pagesize 100. in reader log: see select * (select s_id ,s_prnt_prd,sq, rownum tmp_row_num xxx_sku sq>=:min , sq <=:max order sq asc) rownum <= 100] but observe in writer time 100 sku sent , requests 1 sku sent. public void write(list<? extends xxxpagingbean> pitems) throws xxxskipitemexception { if (mlogger.isloggingdebug()) { mlogger.logdebug("xxxinventoryservicewriter.write() method starting, itemslist size:{0}" +pitems.size()); } .... .... } pagesize , commitinterval set 100 (are these suppose same?) sortkey (seq_id) should same column use in partitiner? bean configurations in xml: <!-- inventoryservice writer configuration --> <bean id="inventorygridservice" class="atg.nucleus.spring.nucleusresolverutil" factory-method="resolvena

REST Web services and the HTTP protocol -

as per understanding , googling found following: restful web services not protocol dependent , can built on other protocol apart http protocol. question: if above said statement true, how rest handle operations different methods (get, post, put, delete etc). aren't these methods http specification dependent , may not available in other protocols? rest architectural style, meaning set of constraints have fulfill "compliant". see exact description in fielding's dissertation: https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm now, http build upon these principles, arguably why became successful, system distributed, cacheable, etc. why can use build restful services/resources on top of it. rest not define exact set of operations, http (get, post, etc.). so in theory, design restful system without http, without operations get/post/etc., practically nobody , should stick http.

angularjs - ng Route with typescript -

i m getting error , ideas why ? "uncaught error: [$injector:nomod] module 'route' not available! either misspelled module name or forgot load it. if registering module ensure specify dependencies second argument." i dont understand really. reqister modules module.requires.push("ngroute"); module.requires.push("route"); angular.module('route') // create new angular module .config(['$routeprovider', function ($routeprovider: angular.route.irouteprovider) { $routeprovider.otherwise('/'); $routeprovider .when('tlob', { templateurl: 'partial/layout.html' }) }]); and @ top of page have ///<reference path="../../typings/tsd.d.ts"/> /// <reference path="../../typings/angularjs/angular-route.d.ts" /> yo

reactjs - Better ES6 / ES7 React support in Visual Studio 2015? Possibly with TypeScript? -

visual studio 2015 support es6/es7 syntax react has definite limitations compared babel / sublime (or atom, vs code, etc). specifically, trying achieve 'support' es6 imports / exports , es7 decorators , class properties in jsx files without turning off js debugging / intellisense in visual studio 2015 (.net 4.5 project not version 5). i've found few things helpful, such hack node server vs utilizes parse jsx (and working on modifying use babel, have ran few issues approach). i have downloaded node tools, turned on es6 intellisense preview, , have typescript 1.7.6 installed. so, better, still has many limitations. it looks microsoft pouring of jsx support typescript. while recognize of benefits of typescript, @ point, don't want write jsx in typescript, understand, valid js valid typescript, , if can achieve better react / es6 / es7 support (or in future) changing extension of files js / jsx ts /tsx, fine; however, when tried this, visual studio 2015 instant

rails bootstrap modal window modal-lg -

i made simple large modal window in rails project. here code: <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#mymodal">open modal</button> <div id="mymodal" class="modal fade" role="dialog"> <div class="modal-dialog modal-lg"> <!-- modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title"> title</h4> </div> <div class="modal-body"> <p>some text in modal.</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">close

android - Spinner value Changing based on parent spinner value changing -

hi , have 3 spinners .in want change second spinner value change based on first spinner value , third spinner change based on second spinner value values fetched , displayed database.i using arrayadapter .i searching last 2 weeks . dont solution kindly me running out of time pls. may help, arrayadapter<string> secondspinneradapter; arrayadapter<string> firstspinneradapter = new arrayadapter<string>( mainactivity.this, android.r.layout.simple_spinner_item, firstspinnervalue); first_spinner.setadapter(firstspinneradapter); firstspinneradapter .setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); firstspinner.setonitemselectedlistener(new onitemselectedlistener() { @override public void onitemselected(adapterview<?> arg0, view arg1, int arg2, long arg3) { // todo auto-generated method stub

Change text color of simple ListView Multiple choice Android -

i developing app cricket. requirement this, if select team 1 list of available country name has display , if select country name india list of player india has displayed , in have select multiple players that. have done everything. problem using android.r.layout.simple_list_item_multiple_choice selecting players. using simple list view , background of list black image. , listview that <listview android:id="@+id/list" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="8.5" android:cachecolorhint="#00000000" /> now problem listview value showing black in color. have black background image. , value black in color. not looking good. how change color of listview values white without changing o custom adapter. and adapter class adapter=new arrayadapter<string>(this,android.r.layout.simple_list_item_multiple_choice,playersname); lvview.setchoicemode(

excel - Copy certain values dependent on date -

i have 2 workbooks : monthly.xlsm , annual.xlsm . starting row 4 , column a, in annual.xlsm dates of year. in monthly.xlsm dates of current month starting column e (the next date in column g) . now, if date correspond , want copy monthly.xlsm cell column date annual.xlsm corespondent row. ex: monthly.xlsm has in e1 date 27.01.2016, in cell e4 value mike. in annual.xlsm , in a8 date 27.01.2016. if true, copy e4 monthly.xlsm dr8 in annual.xlsm . monthly.xlsm has in g1 date 28.01.2016, in cell g4 value mary. in annual.xlsm , in a9 date 28.01.2016. if true, copy g4 monthly.xlsm dr9 in annual.xlsm . i have tried formulas can't figure formula leap cells. in annual.xlsm, in cell dr8 put in formula hlookup(a8,monthly.xlsm!$e$1:$g$4,4,false) . change range , drag formula

Add text colour to a specific column name (header) in DT Shiny datatable -

i new dt in shiny , add text colour specific columns in table, can using formatstyle per below example code chunk. however, add same text colour corresponding column name (header), there easy way this? library(shiny) library(dt) ui = fluidpage(dt::datatableoutput('fdatatable')) server = function(input, output) { output$fdatatable = dt::renderdatatable({ dt::datatable(iris) %>% formatstyle(columns = 1, color = "red") %>% formatstyle(columns = 3, color = "blue") }) } app = list(ui = ui, server = server) runapp(app) any appreciated. you can adding css colnames of table rendering (you need set escape false or html escaped). here's example: library(shiny) library(dt) ui = fluidpage(dt::datatableoutput('fdatatable')) server = function(input, output) { output$fdatatable = dt::renderdatatable({ iris_coloured <- iris colnames(iris_coloured)[c(1,3)] <- paste0('<span style=&quo

jquery - Background center parallax effect jumps to top -

i using below code provide simple parallax effect background image. ideally in css want image centered (not top). however, start scrolling script jumps top , begins effect. cant work out if it's possible alter jquery begins centred image? can help? <div id="para" style="background-image: url('blah')" data-speed="8" data-type="background"> </div> #para { height:500px; float:left; width:100%; background-size:100%; background-position: center center; background-repeat: no-repeat; background-attachemnt: fixed; } //parallax $(document).ready(function() { if ($(window).width() > 1025) { // cache window object $window = $(window); $('div[data-type="background"]').each(function() { var $bgobj = $(this); $(window).scroll(function() { var ypos = -($window.scrolltop() / $bgobj.data('speed'));

javascript - Fortify : DOM based cross site scripting -

i have fortify vulnerability cross site scripting : dom. in application(asp.net) dynamically constructing html , assign div tag complaining issue. str += '<div id="' + itemid + '"'; if(somecondition==true){ str += 'class="' + somevalue + '"'; } if (somevalue == 0) { str += ' style="position: relative; '; str += 'top:0; ' ; str += 'visibility: inherit; ' }else{ str += ' style="position: absolute; '; str += 'top: ' + itemy + '; ' ; str += 'width: ' + w + '; '; str += 'height: ' + h + '; ' str += 'visibility: inherit; ' .... ...... after constructing html, assigning div tag below. var newdiv = document.createelement('div'); document.getelementsbytagname('body').item(0).appendchild(newdiv); newdiv.innerhtml = str; while assigning str newdiv fortify

Datastax Cassandra PHP extention in WAMP -

i using wamp php v5.5.12. trying install datastax php driver( https://github.com/datastax/php-driver ). 1. take compiled dll file here , put in /ext folder 2. add extention=php_cassandra.dll php.ini 3. restarting wamp server i error in wamp php error log: [28-jan-2016 07:32:57 utc] php warning: php startup: unable load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_cassandra.dll' - specified module not found. also installed pear package, there no changes. here experiense cassandra new driver on windows? can problem? i not either make .dll found on pecl php site work. same error. but .dll found here works! http://downloads.datastax.com/php-driver/1.1.0/

xml - Android : Listview not visible when used outside the scrollview -

is possible show listview , scroll view in xml.this xml file. have defined listview outside scrollview. problem when scroll view in device list view not visible. , if view small if not scrolling listview visible. want scroll view below want listview show list data. me out if 1 knows solution or mistake. code <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" > <scrollview android:id="@+id/scrollviewagenda" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/relheader" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <view a

select - how to find duplicates and gaps in this scenario in mysql -

hi have table looks like ----------------------------------------------------------- | id | group_id | source_id | target_id | sortsequence | ----------------------------------------------------------- | 2 | 1 | 2 | 4 | 1 | ----------------------------------------------------------- | 4 | 1 | 20 | 2 | 1 | ----------------------------------------------------------- | 5 | 1 | 2 | 14 | 1 | ----------------------------------------------------------- | 7 | 1 | 2 | 7 | 3 | ----------------------------------------------------------- | 20 | 2 | 20 | 4 | 3 | ----------------------------------------------------------- | 21 | 2 | 20 | 4 | 1 | ----------------------------------------------------------- scenario there 2 scenarios needs handled. so

ios8 - Swift ios 8 issue not update app badge icon but its working in ios 9 Error - Attempting to badge the application icon but haven't received permission -

i have create 1 app on xcode 7 using swift language , , have app register push notification . problem in ios 8 , app ask allow pushnotification message in both (ios8 , ios9) app run on ios 8 return message attempting badge application icon haven't received permission user badge application when have open app time pushnotification in function ios8 , ios9 func application( application: uiapplication, didreceiveremotenotification userinfo: [nsobject : anyobject]) { // print("notification received2: \(userinfo)") application.applicationiconbadgenumber = 0;} but when close app cant able see notification in ios8 working in ios9 here code let settings = uiusernotificationsettings(fortypes: [.alert, .badge,.sound], categories: nil) application.registerusernotificationsettings( settings ) application.registerforremotenotifications() what missing ios8 please give me solution by nishant chandwani please me if cf

collections - Dspace import failed -

i installed dspace 5.4 , trying move collection greenstone dspace. i exported collection greenstone when try load dspace via batch import (zip) following error: notice import failed /dspace/imports/new folder.zip/new folder/exported_dspace/dublin_core.xml (no such file or directory) can tell me have missed? we not have great deal of information go on question, such how did export greenstone. can tell, seems possible did not export data in correct format dspace. the structure should simple archive format archive_directory/ item_000/ dublin_core.xml -- qualified dublin core metadata metadata fields belonging dc schema metadata_[prefix].xml -- metadata in schema, prefix name of schema registered metadata registry contents -- text file containing 1 line per filename file_1.doc -- files added bitstreams item file_2.pdf item_001/ dublin_core.xml contents file_1.png ... to export collectio

javascript - Delete row on website using Node js -

i'm working node js, building app school project, pictures has been uploaded, edited , deleted mysql database. i've managed upload page, pictures can edit, can't succeed delete query. on webpage user has press delete button delete picture row data driver, team, etc. code: index.ejs <% if(pictures.length){ %> <table style="width:100%"> <tr> <th>image</th> <th>driver</th> <th>team</th> <th>location</th> <% if(admin) { %> <th>edit</th> <th>delete</th> <% } %> </tr> <% } %> <% (var = 0; < pictures.length; i++) { %> <tr> <td><img src="images/<%= pictu

ios - Delegate doesn't seem to fire from RBQFetchedResultController -

i'm struggling delegates fire using rbqfetchedresultcontroller ( https://github.com/roobiq/rbqfetchedresultscontroller ). controller drop-in replacement nsfetchedresultcontroller when using realm database. wondering if has had troubles setting delegate? frc perform fetch, doesn't notify delegate when new information needs shown. edit: - (rbqfetchedresultscontroller *)frc { if (_frc != nil) { return _frc; } else { _frc = [[realmcontroller sharedinstance] createformtemplatefrc]; _frc.delegate = self; return _frc; } } this code shows how created , set delegate frc. the issue needed use rbqnotificationmanager class methods register changes. reference: https://github.com/roobiq/rbqfetchedresultscontroller/issues/63

javascript - Node.js 'require'ing other files without needing namespaces -

i switching codebase 100% browser side, mixture of browser side , server side. the issue have found code run using node.js must use modules. in order make code modules, require huge refactor of of code. reason on browser many functions used across files without worrying namespacing. but currently, in node.js have found no way achieve same affect, , solutions have found have not worked. for example of like, able this: //////////// // file1.js //////////// function somefunction(someargs) { /* run stuff, calculate stuff */ return something; } //////////// // file2.js //////////// function somefunction2(someargs) { /* run code */ let somevalue = somefunction(someargs); /* run more code */ } //////////// // file3.js //////////// somefunction2(myarguments); have tried following solutions found here , have not helped me. "masylum" 's answer not need. "udo g" 's answer, referring using eval include other file in run

visual c++ - To send a custom Message from Parent Dialog Box to child Dialog Box using SendMessage() function -

there several ways use sendmessage() win32api modal ::sendmessage(h, my_msg ,0,0); mfc modal let's ptr having child dialog box handle can use modal ptr->sendmessage(my_msg,0,0); but how can child dialog box handle once clicked button in parent dialog box see this .. write code void ccustommessagedlg::onbnclickedopen(){ mydialog2 d2(idd_child_dialog); d2.domodal(); } i need send custom message child dialog using sendmessage() api once button clicked. can please suggest solution problem you cannot send message dialog after domodal() returns, because dialog destroyed. in case want pass data dialog, can add member variable child dialog, say: cstring m_strmydata; then use: mydialog2 d2(idd_child_dialog); d2.m_strmydata = "test"; d2.domodal(); and access m_strmydata within child dialog.

javascript - office-js: Uncaught TypeError: window.external.GetContext is not a function -

i'm struggeling check if hosted web application opened browser or in outlook 2013/2016 client. this approach: /** * check if app running in outlook */ $rootscope.isoutlook = false; $(document).ready(function () { try { office.initialize = function() { var hosttype = office.context.mailbox.diagnostics.hostname; if (hosttype === "outlook" || hosttype === "mac outlook" || hosttype === "outlookwebapp") { $rootscope.isoutlook = true; } }; } catch (e) { if (e instanceof typeerror) { // catch error if web app opened in browser. console.log('not in office context! generated error: ' + e); } } }); $log.debug('isoutlook: ' + $rootscope.isoutlook); the function works charm, can't rid of 'uncaught typeerror'. keeps throwing me uncaught typeerror in console of browser: uncaught typeerror: window.external.g

java - Search same colors (RGB) in same position (i, j) from different arrays (3 array) and lock it -

i made simple learning program create 3 array, put jpanel it, , give random color each (each array have own "randomizer" jtogglebutton ) for learning continuation, thinking of creating 1 more button search same colors in same position arrays array1 [0][0] (r, g, b) = array2 [0][0] (r, g, b), , lock it (so loop can't revalidate color). my questions are: is possible lock position of array array [0][9]? i think should make randomizing loops synchronize first, methodically right? if possible, should start build it? it not question but, please give me instigation if make unnecessary "// copy method" except jtogglebuttons. p.s. question how check 2 array list same content in same position , maybe next step method, others in different language , don't think has same issue. the code: main: public class main { private static void createmainframe() { new window().initmainframe(); } @suppresswarnings("convert2lambda&q

sql server - Binding database to ComboBox -

i have combobox connected sql-server , retrieve columns on it. here's table course_code course ctech computer technician comsci computer science for example, if select computer technician combo box how retrieve course_code ctech in label, if select computer science in combo box how retrieve course_code comsci in label? there's whole bunch of selected... properties selecteditem , selectedvalue etc. see documentation here , pick 1 want/need. what you'll want selectedvalue ; if doesn't work you'll need more specific on how got data combobox (databinding?).

c# - hide webBrowser scrollbar wpf -

i have webbrowser , loading .html file. problem although have set scrollviewer.verticalscrollbarvisibility to"hidden", scrollbar still visible. i have tried approach , not working <webbrowser x:name="personalizedwebbrowser" horizontalalignment="left" verticalalignment="top" scrollviewer.cancontentscroll="false" scrollviewer.horizontalscrollbarvisibility="hidden" scrollviewer.verticalscrollbarvisibility="hidden" loadcompleted="wb_loadcompleted"/> private void wb_loadcompleted(object sender, system.windows.navigation.navigationeventargs e) { mshtml.ihtmldocument2 dom = (mshtml.ihtmldocument2)personalizedwebbrowser.document; dom.body.style.overflow = "hidden"; } could please suggest else? i solved problem using windows forms webbrowser control in wpf project: private void window_loaded(object

c++ - Cannot iterate over map whose elements hold a uniq_ptr -

the following code fails compile: #include <iostream> #include <memory> #include <map> struct haveuniq { std::unique_ptr<int> uniq; }; void print_hus(const std::map<int, haveuniq>& hus) { (const std::pair<int, haveuniq>& p: hus) std::cout << *p.second.uniq << std::endl; } int main() { std::map<int, haveuniq> hus; (int = 0; < 10; ++i) hus[i].uniq = std::unique_ptr<int>(new int(i)); print_hus(hus); } with following error: uniq_wtf.cpp: in function ‘void print_hus(const std::map<int, haveuniq>&)’: uniq_wtf.cpp:10:42: error: invalid initialization of reference of type ‘const std::pair<int, haveuniq>&’ expression of type ‘const std::pair<const int, haveuniq>’ (const std::pair<int, haveuniq>& p: hus) so, tries iterate on values rather constant references, , cannot coerce values references. it clear objects has unique_ptr 1 of fields

ffmpeg Not converting some mov videos to mp4 -

i using ffmpeg convert videos, command works fine videos format including mov not converting mov videos,i don't understand problem in mov video? although video playing on player commands trying : $command = "$ffmpeg_path -i $video_path -acodec copy -ar 22050 -ab 32 -f mp4 -s 858x480 $mobile_video.mp4"; or $command="$ffmpeg_path -i $video_path -codec:v libx264 -preset slow -b:v 550k -maxrate 550k -bufsize 1100k -threads 0 -codec:a libfdk_aac -b:a 128k $mobile_video.mp4"; or $command="$ffmpeg_path -i $video_path -vcodec copy -acodec copy $mobile_video.mp4"; i try these commands mov videos not converted mp4 interesting comment because there entire discussion (and possible answer) here: ffmpeg convert mov file mp4 html5 video tag ie9 ffmpeg -i input.mov -c:v libx264 -c:a libfaac -strict experimental output.mp4

apache spark - Cache MLlib model on SparkJobServer -

can tell me how can persist namedobjects on sparkserver context? know there possibility haven't found solution yet. thanks lot in advance! this merged. see https://github.com/spark-jobserver/spark-jobserver/pull/350

hiveql - Hive Query Language Syntax Highlighting/Colouring -

Image
i'm working hiveql , can't seem find tools syntax highlighting. know of decent editors? ideally find add-on eclipse. thanks! i use notepad++ . once downloaded go settings -> style configurator -> select sql add user ext files (say hql). highlight syntax in hive ql of keywords same ion sql , hql.

multithreading - C++ - Producer / Consumer only allow consumption in defined chunks -

there's 2 threads a (producer) , b (consumer). the data a produces meant read in chunks , hence b shall allowed read once a has produced whole chunk. single piece of data simple struct , chunk length variable. example once b allowed read after 50 pieces of data produced, time might 200. i've found implementation of producer/consumer queue i'd use: https://github.com/cameron314/readerwriterqueue my current idea a writes data std::vector , pass std::vector queue. doubt works since queue not know how memory std::vector take , wants allocate memory beforehand. i hope knows easier solution this. regardless of produce or consume, need concurrent queue communication between producer(s) , consumer(s). if doing c++ style, you'll end like: template<typename t, typename alloc> class concurrent_queue; (note libraries give such containers, intel tbb example). the template parameter t exchange between producers , consumers. asked consume chunk