Posts

Showing posts from June, 2013

oracle - How to show all value of a single column into a single row in pl/sql report? -

i trying show single column single row in pl/sql report. want item ----- itme1 item2 item4 item5 to item ----- item1,item2,item3, item4, item5 i have used following code function cf_hs_descformula return char v_items varchar2(600); begin v_items:=:hs_desc; if v_items not null v_items:=v_items||','; end if; return v_items; end; but not working. please tell me how can that? you can use listagg in oracle: select listagg(name, ', ') within group (order name) "name_list" table1;

php - Drupal 7 Unable to remove/update uploaded file in content type -

i have created content type "product" , want possible attach pdf nodes of content type visitors download, created custom field "download" on content type. the type , widget of field both "file" , in admin have possibility upload / remove file... or @ least, seems so. uploading pdf not problem, added node. if later try remove file - no can't do. can press "remove" button in admin section, , press "save", doesn't give me error , "download" field still empty. if refresh page - bam! there file again. if both remove action , uploading new file @ same time, again; can press "save", doesn't give me error , filename in "download" field name of new file. new file uploaded. again - after refreshing page, original, first file back. i chmodded /files/ directory 777 testing purposes, doesn't solve issue. else clue ? maybe can find clues in logs, don't see related problem @ /admin/r

javascript - How to calculate Fetching Time while fetching data from any Api in Ajax -

i want show amount of data fetched api. output should 10% fetched 90 % remaining that. i'm searching how should calculate amount amount retreived , remaning data left fetched. i have been working on basecamp api waste lots of time fetch tasks , activities etc. want want show time left while fetching in ajax . i have googled , found link: monitoring_progress if body suggest me start appreciate. as far know there no way exact time, can approximation. why can't have exact time ? most of time spent in basecamp servers, not in request. link posted offers way basecamp push progress messages. if don't so, nothing. you can imagine basecamp servers wall. behind wall progress, can't see behind wall , not allowed basecamp climb it. ? you can approximate time. method similar posted here: var ajaxtime= new date().gettime(); $.ajax({ type: "post", url: "some.php", }).done(function () { var total

html - Flex iframe doesn't stretch in IE11 -

the following iframe flex item , supposed stretch , fill available space: <!doctype html> <html> <head> <meta charset="utf-8"> <title>flex iframe</title> <style> body { display: flex; margin: 0; height: 100vh; } span { background: green; } iframe { background: tan; } </style> </head> <body> <span>hello, world!</span> <iframe></iframe> </body> </html> but in ie11 doesn't right: demo is bug? what's cross-browser solution? that's easy: iframe { min-height: 100%; } demo

javascript - jQuery "chosen": conflict with 'selected' attribute in option tag -

i'm having trouble getting jquery snippet work due 'conflict' jquery plugin 'chosen' . i'm using wordpress in case matters. i want set selected attribute in several <option> tags, using jquery( document ).ready(function() { var arr = ["1", "2"]; jquery("#location option").each(function () { if (jquery.inarray(jquery(this).val(), arr) != -1) { jquery(this).prop('selected', true); }; }); }); html output <select name="location[]" multiple="multiple" id="location" class="postform" style="display: none;"> <option value="-1">select location</option> <option class="level-0" value="1">location a</option> <option class="level-0" value="2">location b</option> <option class="level-0" value="3">location

Java API for running UIMA Ruta scripts -

i new uima ruta. made annotators using scripting language. able run them within eclipseide. want write java api automatically run scripts on input provided. i using same example project provided in uima documentation. so far have been able this try { file taedescriptor = null; file inputdir = null; // read , validate command line arguments boolean validargs = false; if (args.length == 2) { taedescriptor = new file(args[0]); inputdir = new file(args[1]); validargs = taedescriptor.exists() && !taedescriptor.isdirectory() && inputdir.isdirectory(); } if (!validargs) { printusagemessage(); } else { // resource specifier xml file xmlinputsource in = new xmlinputsource(taedescriptor); resourcespecifier specifier = uimaframework.getxmlparser() .parseresourc

ios - How to detect Push notification when app is open -

this question has answer here: get push notification while app in foreground ios 12 answers in application have used push notification service problem when close app @ time notification appears when open application , send notification notification not come. please me. you can easily handle function mentioned below in appdelegate.m ---implement application:didreceiveremotenotification: example:- - (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo { uiapplicationstate appstate = [application applicationstate]; if (appstate == uiapplicationstateactive) { uialertview *alertvw = [[[uialertview alloc] initwithtitle:@"notify" message:yourmessage delegate:self cancelbuttontitle:@"done" otherbuttontitles: @"vizllx", nil] autorelease]; [aler

ios - Merge paid app and free app with in app purchase -

i have 2 application on appstore free app in app purchase. paid app. now, want keep 1 app on appstore above options 1.free app in app purchase , remove paid app. here want give app full functionality user used paid app (purchased paid app). here question how can merge these 2 app single app free , contains in app purchase keeping paid app user ? if have idea regarding please share. thanks in advance. i solved problem using icloud. first provided update both application doing following changes. i used "key value store" icloud option , stored setting on icloud need make sure here "icloud key-value store" value in .entitlements file (which automatically created xcode) in both application same both application. setting stored here accessible both application , depending on setting identified user , gave access specific functionality.

Swap positions of Radios - Android java -

i got 1 radiogroup 4 radios. radiogroup rg = (radiogroup) findviewbyid(r.id.radiogroup); radiobutton r0 = (radiobutton) findviewbyid(r.id.radio0); radiobutton r1 = (radiobutton) findviewbyid(r.id.radio1); radiobutton r2 = (radiobutton) findviewbyid(r.id.radio2); radiobutton r3 = (radiobutton) findviewbyid(r.id.radio3); i set text of them. r0.settext("1"); r1.settext("2"); r2.settext("3"); r3.settext("4"); so got radios 1, 2, 3, 4. how can randomly swap positions of radios. want 3,2,1,4 or 2,3,1,4....etc... important don't want change text of radios, said want positions swapped. i don't think can achieve using same layout xml file. use 4 different layouts, , inflate randomly. all ids work if keep same in each xml file. @override public void oncreate(final bundle bundle) { super.oncreate(bundle); setcontentview(randomlayout()); radiogroup rg = (radiogroup) findviewbyid(r

.net - Crash of my command line tool when it tries to access some Console Cursor related properties -

i'm trying retrieve standard output little command line tool wrote (in .net too) starting process this . it works except if command line tool tries retrieve console.cursortop property, or tries set console.cursorvisible property. in cases, crashes. i don't understand why happening, other methods or properties of console might work theses don't. there kind of hidden cursor object in console never initialized if started way? this tool works fine if launch explorer or if run in cmd. could explain me why happens , how can prevent it? thanks.

sql - how to fetch this data in one query? -

i want fetch data in simple query i use select user_id , order_id product order_id = 3 group user_id , order_id ; but result 1 row group example input: #user_id #order_id 1 2 1 3 2 3 2 4 3 1 3 4 3 5 4 1 4 3 4 12 4 6 5 4 where order_id = 4 then output : #user_id #order_id 2 3 2 **4** 3 1 3 **4** 3 5 5 **4** try this: select p2.user_id, p2.order_id product p1 inner join product p2 on p1.userid = p2.userid p1.order_id = 4 this should effective way data. if slow you, should create proper indexes on product table. also note work specifying 1 single order_id , need adjustments more order_id s ( distinct , specific) , bigger difference selecting userid.

ado.net - How do I get unique Linq-to-Entities results when there is no primary key? -

Image
i have entity model of oracle data source on have no control. using model query particular view see volume price breaks given product: as can see, view has no primary key. here linq using: var db = getoracledatacontext(); var result = db.itempricebreaks_v.where(p => p.stockno == stockid).tolist(); this works degree, instead of returning 4 distinct records own quantities , pricing, returns 4 identical records, each pricing , quantities of first record ($4800, 0, 2). i have no control on view. there way can structure linq query can 4 distinct values? select fields care , use distinct(). example: var result = db.itempricebreaks_v .where(p => p.stockno == stockid) .select(p => p.price) .distinct() .tolist(); however, i'd recommend, along other commenters, primary key involved.

ios - How can I replace selected customTableCellA with customTableCellB -

how can replace selected customtablecella customtablecellb i have table view working customtablecellas i want replace customtablecella customtablecellb when selected. customtablecellb 50 pixels taller customtablecella how can implement properly? try this, create @property array nsmutablearray *selectedindexpatharray , instantiate in viewdidload , - (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath { cgfloat cellheight = //customtablecella height if ([self.selectedindexpatharray containsobject:indexpath]) { cellheight = //customtablecellb height } else { cellheight = //customtablecella height } } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { ... if ([self.selectedindexpatharray containsobject:indexpath]) { //load customtablecellb } else { //load customtablecella } //other code ... }

java - Opengl Rendering - Anything outside of the z range -1 to 1 doesn't appear? -

anything render outside of range 1 -1 (in z-range) doesn't appear on screen. i've been trying everything, including using different matrices try transform vertices outside of 1 -1 range nothing seems work. i'll put code in below. consists of model class data stored, shader program(which won't include - pretty simple) , main class. vertex shader #version 330 core in vec4 in_position; in vec4 in_color; out vec4 pass_color; void main(void) { gl_position = in_position; pass_color = in_color; } fragment shader #version 330 core in vec4 pass_color; out vec4 out_color; void main(void) { out_color = pass_color; } model class package util; import static org.lwjgl.opengl.gl11.*; import static org.lwjgl.opengl.gl15.*; import static org.lwjgl.opengl.gl30.*; import static org.lwjgl.opengl.gl20.*; import java.nio.bytebuffer; import java.nio.floatbuffer; public class model { // vertex array id int vaoid; // vbo id's int vbovertexid, vbocolorid, vboin

c# - Pull information from partialview into final partialview before submit? -

i have form uses partialviews load different sections. when information filled out show on final partialview give confirmation page before submission. how grab information entered on 1 partialview , display submit on final? my partialview code looks this: @using (ajax.beginform("primaryapplicant", new ajaxoptions { httpmethod = "post", insertionmode = insertionmode.replace, updatetargetid = "step3", onsuccess = "showstep3" })) { <h4>primary applicant information</h4> @html.antiforgerytoken() @html.validationsummary(true) <hr/> <div class="form-group"> @html.labelfor(m => m.firstname, new { @class = "col-md-3 control-label" }) <div class="col-md-9"> <div class="col-md-4"> @html.textboxfor(m => m.firstname, new { @class = "form-control", placeholder = "first name" }) </div> <div class=&

android - App not supported on some devices -

my app doesn't support specific android device (samsung galaxy tab 3 10.1 p5210), though supports other 10 inch tablets. clueless why happening. reason? the client has above mentioned tablet , app doesn't listed on store. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.app" android:versioncode="8" android:versionname="1.7" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="19" /> <permission android:name="com.example.app.permission.maps_receive" android:protectionlevel="signature" /> <uses-permission android:name="com.example.app.permission.maps_receive" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="a

c# - Managing membership provider on web service the right way -

i have silverlight 5 app , wcf service stores/gets membership api information related users sybase anywhere provider. piece of web.config : ... <profile defaultprovider="saprofileprovider"> <providers> <clear /> <add name="saprofileprovider" type="ianywhere.web.security.saprofileprovider" connectionstringname="mycontext" applicationname="/" commandtimeout="30" /> </providers> <properties> <add type="system.string" name="myuserdata" /> ... the service returns data stored in myuserdata public string getmyuserdata() { try { string result = null; result = httpcontext.current.profile.getpropertyvalue("myuserdata") string; if (result == null) { result = string.empty; } return result; } c

c# - Is SqlGeometry.STUnion method thread safe? -

is sqlgeometry.stunion method thread safe in .net? msdn decompiled body sql 11.0 assembly using justdecompile: [sqlmethod(isdeterministic=true, isprecise=false)] public sqlgeometry stunion(sqlgeometry other) { if (this.isnull || other == null || other.isnull || this.srid != other.srid) { return sqlgeometry.null; } this.throwifinvalid(); other.throwifinvalid(); return sqlgeometry.construct(glnativemethods.union(this.geodata, other.geodata), this.srid); } where sqlgeography.construct , glnativemethods.geodeticunion static methods, while others can't deadlocked anywhere. none of methods used modifying calling object, yes - it's thread safe.

Rails polymorphic association call model that doesn't exist -

i've problem call model doesn't exist. have model commandset on polymorphic association model recordlevelsecurity has securable field can contains ibmicommandset or commandset . i've 1 model ibmicommandset , commandset , it's of course commandset .so have tried find role recordlevelpermission that contains recordlevelsecurity 's id.rails gives following error after attempt find role. def edit @system_settings = @@system_settings @role = role.find(params[:id], :include => {:record_level_permissions => {:record_level_security => :securable}}) set_view_only if !params[:page] && !params[:list] show_role elsif params[:list] render_list_partial else render_edit_partial end end nameerror (uninitialized constant ibmicommandset): org/jruby/rubyarray.java:1612:in `each' org/jruby/rubyarray.java:1612:in `each' org/jruby/rubykernel.java:2105:in `send' org/jruby/rubyarray.java:1612:in `eac

javascript - Select drop down text-align center in safari? -

select drop down css display: block; height: 60px; margin-left: 10%; margin-right: 10%; margin-top: 10px; min-height: 60px; text-align: center; option text centered in firefox browser,but not in safari, there solution text aligned in center in safari browser? add padding , remove height. example here update of code have supplied: display: block; margin-left: 10%; margin-right: 10%; margin-top: 10px; padding-top: 10px; padding-right: 20px; padding-bottom: 10px; padding-left: 20px; update unfortunately padding may not work in safari (iphone). in case try using text indent instead of padding. , add text indent of width of drop down menu. please see update of code provided: display: block; height: 60px; margin-left: 10%; margin-right: 10%; margin-top: 10px; min-height: 60px; width: 220px; /* width of 200px plus 20px text indent */ text-indent: 20px;

android - How to Choose a file from files in SDCard? -

i have text files on android's sd card, , need access 1 of them. came across below code here : //find directory sd card using api //*don't* hardcode "/sdcard" file sdcard = environment.getexternalstoragedirectory(); //get text file file file = new file(sdcard,"file.txt"); //read text file stringbuilder text = new stringbuilder(); try { bufferedreader br = new bufferedreader(new filereader(file)); string line; while ((line = br.readline()) != null) { text.append(line); text.append('\n'); } } catch (ioexception e) { //you'll need add proper error handling here } //find view id textview tv = (textview)findviewbyid(r.id.text_view); //set text tv.settext(text); but in part of code: //get text file file file = new file(sdcard,"file.txt"); the name of text file specified need user choose text file wants (from text files in sd card). how can let user brows sd card , choose file wants?

pdf - Google CSE limit indexing of single file? -

i have been using google cse index several long pdf files searching (some 500+ pages long). noticing search find terms close beginning of of these documents, not terms near end of document. there limit how of single file google index? since no 1 seems know, provide experience. have requested manual index of pdf files several times, , still cannot search pick search terms past page 10-15. seems there character limit on how of single pdf gets indexed. google support not available confirm until business version purchased, won't doing.

python - Building a Tree with inorder and preorder traversal in Python3.x -

i trying build tree using preorder , inorder traversals (list of ints). here have far: def build(preorder, inorder, heap): # builds tree inorder , preorder traversal if len(preorder) == 0: return none root = preorder[0] # root first item in preorder k = root left_count = inorder[(k-1)] # number of items in left sub-tree left_inorder = inorder[0:left_count] left_preorder = preorder[1:1+left_count] right_inorder = inorder[1+left_count:] right_preorder = preorder[1+left_count:] return [root, build(left_preorder, left_inorder), build(right_preorder, right_inorder)] i believe algorithm correct, although wrong. my question - @ point insert items tree? have class written handle this, i'm not sure insert call, function operate recursively. suggestions how should insert nodes tree appreciated. class heap: def __init__(self,the_heap): self.heap = the_heap def getchildren(self,value): n = self.heap.in

actionscript 3 - Flash AS3 movieclip doesn't stop motiontween and no errors are given -

Image
i have following piece of code: var note1:movieclip = mcnote1; //init note1.stop(); the instance name , correct yet doesn't stop movieclip?? here short overview of flash file you try couple things. edit movie clip , insert keyframe , add "stop();" frame 1 of movieclip. or try "note1.gotoandstop(1);" in main function.

google maps - How to pass a variable into a function defined in the argument of another function in JavaScript? -

this question has answer here: google maps : issue regarding marker icons , geocoding 1 answer javascript closure inside loops – simple practical example 31 answers i working on google maps api v3 javascript. using geocoder feature passing city name , plotting on map. along marker, want add separate info window every marker not able that. infowindows displaying content set last marker instead of setting different info window each. please find javascript code below: function initialize() { geocoder = new google.maps.geocoder(); var address = document.getelementbyid('address').value; var jstring = json.parse(address); var infowindow; (var key in jstring) { contentstr = json.string

emacs - Define key-chord key with specific mode -

how define key-chord key in specific mode, example want bind cider repl specific key in clojure-mode or cider-mode . can find example activates key globally. thanks help. edit: (require 'evil) (require 'key-chord) (evil-mode 1) (key-chord-mode 1) (key-chord-define evil-insert-state-map "jk" 'evil-normal-state) (key-chord-define-global "gt" 'other-window) (key-chord-define clojure-mode-hook "gj" 'cider-jack-in) ;; error : wrong type argument: keymapp, (rainbow-delimiters-mode) (provide 'init-evil) defining mode-specific key bindings here example of how this: (define-key clojure-mode-map (kbd "c-c r") 'cider-repl) ... of course have replace cider-repl specific command want bind. note quote ' before command name required. to generalize: (define-key <mode-map> <key-binding> '<command>) key-chord -specific instructions you need change line you're trying

java - How do I init my object in Application instance asynchronously? -

i have messaging "service"(not android service) , want initialize once in applicaion's oncreate , provide "service" app componens. the problem messagebus should initialized on separate thread, since performes network operations. how eliminate race condition if client tries access messagebus instance? say, activity tries messagebus, it's still not initialized? public interface serviceprovider { public messagebus getmessagebus(); } public class myapplication extends application implements serviceprovider { private messagebus messagebus; @override public void oncreate(){ super.oncreate(); new thread(new runnable() { @override public void run() { try { messagebus = new messagebusimpl(); } catch (exception e) { log.d(tag, "failed init messagebus");

GIT: remove remote branches with no local tracking branch -

let's git branch -a outputs this: a b c *master remotes/origin/a remotes/origin/b remotes/origin/c remotes/origin/master remotes/origin/x remotes/origin/y remotes/origin/z in bold branches (x, y, z) in remote repository have not checked them out yet , don't intend to, related project don't participate in. is there command remove remote branches ( those saved on repository, not actual remote branch in remote ) not have local tracking branch? edit : intend remove remote branches saved in repository, showing existence of branch in remote. not want remove actual branches in remote. edit 2 : clarification in comment mattmilten you can recreate remote branches git pull , don't git pull . i git fetch origin master b c , merge or rebase or want branches master, a, b or c. point is, whenever "git pull" (for reason), branches don't want created , seems have no simple option remove them afterwards. no, not possible. informat

Vim: Shortcuts specific to a file extension? -

this question has answer here: gvim , multiple programming languages 4 answers in vim, possible attach syntax highlighter file extension. is possible same keyboard shortcuts? i.e. shortcuts switch on if file particular extension being edited. the association not directly file extensions, filetypes (which can detected based on file extensions, other file patterns or contents). :setl filetype? shows current buffer's. to define filetype-specific mapping, append <buffer> attribute after :map command. (same custom commands, use -buffer after :command .) you can define filetypes prepending :autocmd filetype {filetype} ... , , put ~/.vimrc . gets unwieldy add mappings , other settings various filetypes. better put commands ~/.vim/ftplugin/{filetype}_mappings.vim . (this requires have :filetype plugin on .)

Magento Backend > Product Attributes showing less attributes that it should -

when in backend can't see custom attributes. same occurs in frontend. i selected eav_attribute table , can see 179 product attributes (type = 4). backend product > attributes shows 119. anyone know happening? magento version: 1.7.0.2 in admin grid attributes, attribute collection retrieved this: $collection = mage::getresourcemodel('catalog/product_attribute_collection') ->addvisiblefilter(); so not attributes exist listed in there. ones marked is_visible in catalog_eav_attribute table. try select , see get. select * eav_attribute e left join `catalog_eav_attribute` ce on e.attribute_id = ce.attribute_id e.entity_type_id = 4 , ce.is_visible = 1 this should attributes listed in admin grid.

javascript - In AngularJS is there such a thing as a finally that runs after $http? -

my code looks this: $scope.login = function (username, password, rememberme) { authentication.authenticating = true; var config = { method: 'post', url: '/api/account/login', data: { 'username': username, 'password': password, 'rememberme': rememberme } }; $http(config) .success(function (data) { authentication.authenticating = false; authentication.isauthenticated = true; $scope.template = $scope.templates[1]; $scope.username = username; }) .error(function (data) { $scope.loginerror = "invalid username/password combination"; authentication.authenticating = false; }); }; is there way can move authentication.authenticating = false; code block execute after error or success ? yes, since $http returns promi

How to construct query to get a single row output in MS SQL SERVER 2012 -

i purely newbie on ms sql programming need on problem want subscription types other table making them column name if meet criteria. query working duplicate result set , that's not want these queries work. here's queries. this sample output want. divisionsname benchmark goalgetter tax credits aaa yes no yes bbb no yes yes code give me divisionsname benchmark goalgetter tax credits<br> aaa yes no no aaa no no yes bbb no yes no bbb no no yes the query is select sectors.name sector_name, companies.name company_name, divisions.name primary_office, addresses.address1 address1, addresses.address2 address2, addresses.address3 address3, addresses.town town, addresses.postcode postcode, counti

ember.js - How can I keep the main navigation highlighted while navigating to different sub/sibling pages? -

how can keep main navigation highlighted while navigating different sub/sibling pages? app has sibling pages shared sub navigation: window.app = ember.application.create(); app.router.map(function() { this.resource('charts', {path: 'charts'}, function(){ this.resource('chart-index', {path: 'index'}); this.resource('chart-archive', {path: 'archive'}); }); }); my templates: <script type="text/x-handlebars"> <div> {{#link-to "chart-index" class="tab-item"}} charts {{/link-to}} </div> {{outlet}} </script> <script type="text/x-handlebars" id="charts"> <div> {{#link-to 'chart-index' class="control-item"}} latest chart {{/link-to}} {{#link-to 'chart-archive' class="control-item"}} chart archive

c# - Return list of parents with the object -

i using entity framework , linq , trying return array of parents without using loop. here example 1 facing (i can't give real example same thing). there person , when retrieve person, want array of person's ancestors (male only). return , array [father, grandfather, great-grandfather,...] until "father" property null, or in other words don't know person's father is. best way entity framework? here's example: class person() { public string name { get; set; } public guid fatherid { get; set; } public virtual person father { get; set; } } class persondto() { public string name { get; set; } public ienumerable<persondto> ancestors { get; set; } } how loop is: person person = context.people.find(personid); persondto persondto = person.todto(); person father = person.father; while (father != null) { persondto.ancestors.add(father.todto()); father = father.father; } assuming there foreign key on person tab

Pl/Sql Trigger for changing default date format in oracle -

i want ensure every time logon date format changed '24-apr-2014' '24/04/2014' for created pl/sql trigger follows create or replace trigger change_date_format after logon on database begin alter session set nls_date_format = 'mm/dd/yyyy'; end; / however not logged on sysdba perhaps thats why error sql> @c:/pl/datetrigger.sql after logon on database * error @ line 2: ora-01031: insufficient privileges what can ensure date format changed permanently? your error means not allowed create such trigger. on wrong track. must set default @ database level. setting default datetime format template from oracle documentation the default datetime format template specified either explicitly initialization parameter nls_date_format or implicitly initialization parameter nls_territory . can change default datetime formats session alter session statement. then case format must set in d

ios - Programmatically detect which app store the app was downloaded from -

i haven't found thread must ask: there way programmatically detect app store app downloaded from? (ie: germany app store) i don't want have ask location privileges detect user location if there isn't way detect app store may have to. i think you'd use current locale of user detect in country are… fail sometimes, i'm not sure if not 100% effective way detect appstore work you. you'd need call [[nslocale currentlocale] objectforkey: nslocalecountrycode] also, please see discussions in following threads, of them old, find alternatives solutions link1 , link2

c - Create sysfs entry from kernel module -

i want pass string > 1024 chars module (filesystem). kernel parameters limited 1024 chars, someone recommended use sysfs instead. i tried include this example in super.c class create string 'filename' & string 'code' entry in sysfs module. static decl_subsys(myfs, null, null); struct myfs_attr { struct attribute attr; char *value; }; static struct myfs_attr fname = { .attr.name="filename", .attr.owner = this_module, .attr.mode = 0644, .value = "/my/test/path", }; static struct myfs_attr code = { .attr.name="code", .attr.owner = this_module, .attr.mode = 0644, .value = "0101", }; when compiling module lot of errors (line 41 decl_subsys): fs/myfs/super.c:41:26: error: expected ‘)’ before ‘(’ token fs/myfs/super.c:50:2: error: unknown field ‘owner’ specified in initializer fs/myfs/super.c:50:2: warning: initialization incompatible pointer type [enabled default] fs/myfs/s

javascript - forEach on a 'new Array' isn't doing what I expect -

i'm learning how use js higher-order functions (map, foreach, reduce, etc), , have stumbled confusion. i'm trying write simple 'range' function, can't seem populate output array. goal: range(1, 4) // [1, 2, 3, 4] i'm getting this: [undefined × 4] here code: function range(num1, num2) { var rangearr = new array((num2 + 1) - num1); return rangearr.map(function(e, i, arr) {return arr[i] = num1 + i}); } what missing here? far can tell problem appears have way i'm utilizing 'new array', beyond i'm lost. oh, , here's part confuses me. works fine: function bleck() { var blah = [1, 2, 3, 4]; var x = 'wtf'; return blah.map(function(e, i, arr) {return arr[i] = x}) } ["wtf", "wtf", "wtf", "wtf"] thanks!! the foreach method iterates on the indices of array . interestingly enough, when create new array via new array(n) , contains no indices @