100+ results for 'i++'

Not the results you expected?

genericRC.cc (https://gitlab.com/pranith/macsim) C++ · 544 lines

19 grid_xloc.resize(no_nodes);

20 grid_yloc.resize(no_nodes);

21 for( uint i = 0; i < no_nodes; i++ )

22 {

23 grid_xloc[i] = i % grid_size;

514 vcs = ch;

515 addresses.resize(ch);

516 for ( uint i = 0 ; i<ch ; i++ )

517 {

518 addresses[i].route_valid = false;

526 {

527 uint channels = addresses.size();

528 for ( uint i=0 ; i<channels ; i++ )

529 if(addresses[i].route_valid)

530 return false;

crackdecl.cpp (https://github.com/aras-p/dingus.git) C++ · 400 lines

16 CD3DXCrackDecl::CD3DXCrackDecl()

17 {

18 for(UINT i = 0; i < 16; i++)

19 {

20 dwStride[i] = 0;

242 cData = 4;

243

244 for(UINT i = 0; i < cData; i++)

245 pData[i] = Data[i];

246 }

262 case D3DDECLTYPE_USHORT2N:

263 case D3DDECLTYPE_USHORT4N:

264 for(; i < cData; i++)

265 Data[i] = (0.0f > pData[i]) ? 0.0f : ((1.0f < pData[i]) ? 1.0f : pData[i]);

266 break;

SideKickActions.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 348 lines ✨ Summary

This Java code is part of a plugin for the JEdit text editor, providing features related to code completion and navigation within a specific programming language. It handles tasks such as setting delay times for completion, toggling between instant and delayed completion, and navigating through assets in a project. The code interacts with JEdit’s properties and event system to provide these features.

238

239 // see if caret is at the end of a child of the current asset

240 for(int i = 0; i < node.getChildCount(); i++)

241 {

242 Asset asset = (Asset)((DefaultMutableTreeNode)node.getChildAt(i))

254 DefaultMutableTreeNode parent = (DefaultMutableTreeNode)

255 node.getParent();

256 for(int i = 0; i < parent.getChildCount(); i++)

257 {

258 if(node == parent.getChildAt(i))

306

307 // see if caret is at the end of a child of the current asset

308 for(int i = 0; i < node.getChildCount(); i++)

309 {

310 Asset asset = (Asset)((DefaultMutableTreeNode)node.getChildAt(i))

check_names.c (https://bitbucket.org/vrrm/brl-cad-copy-for-fast-history-browsing-in-git.git) C · 693 lines

31 name[namelen] = '\0';

32 }

33 for( i=0 ; i<namelen ; i++ )

34 {

35 if( isspace( name[i] ) || name[i] == '/' )

70 /* replace white space */

71 namelen = strlen( name );

72 for( i=0 ; i<namelen ; i++ )

73 {

74 if( isspace( name[i] ) || name[i] == '/' )

114 ptr = ptr->next;

115 }

116 i++;

117 if( 'A'+i == '[' )

118 i = 'a' - 'A';

dec_helpers.go (https://gitlab.com/OBSERVER-DLL/go) Go · 469 lines

64 return false

65 }

66 for i := 0; i < length; i++ {

67 if state.b.Len() == 0 {

68 errorf("decoding bool array or slice: length exceeds input size (%d elements)", length)

87 return false

88 }

89 for i := 0; i < length; i++ {

90 if state.b.Len() == 0 {

91 errorf("decoding complex64 array or slice: length exceeds input size (%d elements)", length)

112 return false

113 }

114 for i := 0; i < length; i++ {

115 if state.b.Len() == 0 {

116 errorf("decoding complex128 array or slice: length exceeds input size (%d elements)", length)

turing.enumerable.js (https://github.com/dcx2011/turing.js.git) JavaScript · 391 lines

40 enumerable.forEach(callback, context);

41 } else if (global.isNumber(enumerable.length)) {

42 for (var i = 0, l = enumerable.length; i < l; i++) callback.call(enumerable, enumerable[i], i, enumerable);

43 } else {

44 for (var key in enumerable) {

CustomerTyp.java (https://github.com/biemond/soa11g_examples.git) Java · 412 lines

292 for (int i=0;

293 i<java.lang.reflect.Array.getLength(getAddresses());

294 i++) {

295 java.lang.Object obj = java.lang.reflect.Array.get(getAddresses(), i);

296 if (obj != null &&

SystemPreislisten.java (https://github.com/bomm/thera-pi-2.git) Java · 369 lines

73 if(treffer==0){

74 vKGPreise.clear();

75 for(int i = 0; i < tarife;i++){

76 preisliste.clear();

77 preisliste = (Vector<Vector<String>>)SqlInfo.holeFelder("select * from kgtarif"+Integer.toString(i+1));

115 if(treffer==1){

116 vMAPreise.clear();

117 for(int i = 0; i < tarife;i++){

118 preisliste.clear();

119 preisliste = (Vector<Vector<String>>)SqlInfo.holeFelder("select * from matarif"+Integer.toString(i+1));

157 if(treffer==2){

158 vERPreise.clear();

159 for(int i = 0; i < tarife;i++){

160 preisliste.clear();

161 preisliste = (Vector<Vector<String>>)SqlInfo.holeFelder("select * from ertarif"+Integer.toString(i+1));

CTRTextureLightMap2_Add.cpp (https://gitlab.com/Lumirion/M2Viewer) C++ · 672 lines

204

205

206 for ( s32 i = 0; i <= dx; i++ )

207 {

208 #ifdef CMP_Z

SingleRowLayout.java (https://bitbucket.org/nbargnesi/idea.git) Java · 491 lines

330 }

331

332 for (int i = 1; i < data.myVisibleInfos.size() - 1; i++) {

333 final TabInfo each = data.myVisibleInfos.get(i);

334 final TabInfo prev = data.myVisibleInfos.get(i - 1);

426

427 if (c instanceof JBTabsImpl) {

428 for (int i = 0; i < myLastSingRowLayout.myVisibleInfos.size() - 1; i++) {

429 TabLabel first = myTabs.myInfo2Label.get(myLastSingRowLayout.myVisibleInfos.get(i));

430 TabLabel second = myTabs.myInfo2Label.get(myLastSingRowLayout.myVisibleInfos.get(i + 1));

461 boolean isDropTarget = myTabs.isDropTarget(info);

462 if (!isDropTarget) {

463 for (int i = 0; i <= index; i++) {

464 if (myTabs.isDropTarget(myLastSingRowLayout.myVisibleInfos.get(i))) {

465 index -= 1;

lm87.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 991 lines ✨ Summary

This C code implements a driver for the LM87 temperature sensor, which is used to monitor system temperatures. It provides functions for reading and updating sensor data, as well as handling device initialization, removal, and updates. The code also includes support for fan control and alarm notifications. It is designed to work with Linux’s kernel and is part of the Linux kernel’s sensor subsystem.

856

857 /* Limits are left uninitialized after power-up */

858 for (i = 1; i < 6; i++) {

859 lm87_write_value(client, LM87_REG_IN_MIN(i), 0x00);

860 lm87_write_value(client, LM87_REG_IN_MAX(i), 0xFF);

861 }

862 for (i = 0; i < 2; i++) {

863 lm87_write_value(client, LM87_REG_TEMP_HIGH[i], 0x7F);

864 lm87_write_value(client, LM87_REG_TEMP_LOW[i], 0x00);

908 i = (data->channel & CHAN_TEMP3) ? 1 : 0;

909 j = (data->channel & CHAN_TEMP3) ? 5 : 6;

910 for (; i < j; i++) {

911 data->in[i] = lm87_read_value(client,

912 LM87_REG_IN(i));

XMLHttpRequest.cpp (https://bitbucket.org/ultra_iter/qt-vtl.git) C++ · 1131 lines

108 {

109 unsigned length = name.length();

110 for (unsigned i = 0; i < length; i++) {

111 UChar c = name[i];

112

RootImporter.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 176 lines ✨ Summary

This Java class, RootImporter, is a part of a project viewer application. It imports files and/or directories from the project root, optionally removing existing files under the root before doing a fresh import. The importer can be customized to use a different parent component for the dialogs shown to the user.

150 /** Unregisters all files in the directory from the project, recursively. */

151 protected void unregisterFiles(VPTDirectory dir) {

152 for (int i = 0; i < dir.getChildCount(); i++) {

153 VPTNode n = (VPTNode) dir.getChildAt(i);

154 if (n.isDirectory()) {

RecentFilesProvider.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 194 lines ✨ Summary

This Java code implements a menu provider for a text editor, specifically a “Recent Files” menu. It displays a list of recently opened files and allows users to navigate through them by typing file names in a search field. The menu also includes options to clear the recent files history and sort the list alphabetically.

166 {

167 Collections.sort(menuItems, new MiscUtilities.MenuItemCompare());

168 for(int i = 0; i < menuItems.size(); i++)

169 {

170 if(menu.getMenuComponentCount() >= maxItems

FFNet.cc (https://freespeech.svn.sourceforge.net/svnroot/freespeech) C++ · 422 lines ✨ Summary

This C++ code defines a class FFNet that represents a neural network. It provides methods for training and testing the network, including reading from an input stream, printing information about the network, and updating its weights based on gradients calculated during training. The code also includes functions for parsing and serializing the network’s topology and layers.

11 {

12 //topo = _topo;

13 for (int i=0;i<topo.size()-1;i++)

14 {

15 layers[i]=new FFLayer(topo[i+1],topo[i], functions[i]);

24 {

25 //topo = _topo;

26 for (int i=0;i<topo.size()-1;i++)

27 {

28 if (i==topo.size()-2)

40 {

41 layers[0]->update(input);

42 for (int i=1;i<layers.size();i++)

43 layers[i]->update(layers[i-1]->getValue());

44 return layers[layers.size()-1]->getValue();

JsonRestStore.js (http://enginey.googlecode.com/svn/trunk/) JavaScript · 321 lines ✨ Summary

This JavaScript code defines a test suite for a data store called jsonStore. It tests various aspects of the store, including schema validation, read API functionality, and performance under heavy loads. The tests are designed to ensure the store’s correctness and robustness in different scenarios. The code uses various libraries and frameworks, such as Dojo and dojo.data.ItemFileReadStore, to create a comprehensive test suite for the jsonStore.

284 var now = new Date().getTime();

285 var result;

286 for(var i=0;i<100000;i++){

287 }

288 console.log("Just Loop",new Date().getTime()-now, result);

289 now = new Date().getTime();

290 for(i=0;i<100000;i++){

291 result = item.name;

292 }

294

295 now = new Date().getTime();

296 for(i=0;i<100000;i++){

297 result = jsonStore.getValue(item,"name");

298 }

test_overlap.html (http://enginey.googlecode.com/svn/trunk/) HTML · 70 lines ✨ Summary

This HTML code creates a web page that showcases two schedulers, zOrder and BSP, from the dojox.gfx3d library. It displays a 500x500 pixel canvas where two polygons are rendered with different fill colors. The page includes buttons to switch between the two schedulers, which change the rendering of the polygons. The current scheduler is displayed on the page, allowing users to compare the performance of both algorithms.

23

24 var m = dojox.gfx3d.matrix;

25 for(var i = 0; i < tas.length; i++){

26 console.debug(fills[i]);

27 view.createPolygon(tas[i])

test_events.html (http://enginey.googlecode.com/svn/trunk/) HTML · 189 lines ✨ Summary

This HTML code creates a web page with two grids: an event tracking grid and a standard grid. The event tracking grid displays data about various events, such as cell clicks and mouse overs, while the standard grid contains sample data. The code uses Dojo, a JavaScript framework, to create and manage the grids.

118 var properties = eRow.properties;

119 if (properties)

120 for (var i=0, l=properties.length, p; (p=properties[i] || i < l); i++)

121 eRow.data[p] = inEvent[p];

122 else

137 }

138 }

139 for (var i=0, e; (e=eventRows[i]); i++)

140 grid[e.name] = makeEvent(i, e.name);

141 }

EditingOptionPane.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 422 lines ✨ Summary

This Java code is part of a text editor’s configuration management system. It defines a class that manages settings for different modes (e.g., programming languages) and buffers (e.g., editing windows). The class loads, saves, and updates these settings based on user input and file changes, ensuring consistency across the application.

56 modeNames[0] = jEdit.getProperty("options.editing.global");

57

58 for(int i = 0; i < modes.length; i++)

59 {

60 modeProps[i] = new ModeProperties(modes[i]);

144 global.save();

145

146 for(int i = 0; i < modeProps.length; i++)

147 {

148 modeProps[i].save();

StyleOptionPane.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 453 lines ✨ Summary

This Java code is a graphical user interface (GUI) for editing syntax highlighting settings. It allows users to select font styles, colors, and sizes for text editors. The GUI consists of checkboxes and buttons that enable users to customize their text editor’s appearance. When the “OK” button is clicked, the selected settings are applied to the text editor.

200 public void save()

201 {

202 for(int i = 0; i < styleChoices.size(); i++)

203 {

204 StyleChoice ch = (StyleChoice)styleChoices

UnixFileSystem.php (git://github.com/alexgorbatchev/SyntaxHighlighter.git) text · 0 lines

88 $n = strlen($strPathname);

89 $prevChar = 0;

90 for ($i=0; $i < $n; $i++) {

91 $c = $strPathname{$i};

92 if (($prevChar === '/') && ($c === '/')) {

122 }

123 $prevChar = 0;

124 for ($i = $offset; $i < $n; $i++) {

125 $c = $pathname{$i};

126 if (($prevChar === '/') && ($c === '/')) {

IOProgressMonitor.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 217 lines ✨ Summary

This Java code creates a GUI panel, IOProgressMonitor, that displays the progress of I/O operations on multiple threads. It uses a JProgressBar to show the progress and a button to abort the operation. The panel updates in real-time as new progress information is received from the underlying thread pool.

53

54 Box box = new Box(BoxLayout.Y_AXIS);

55 for(int i = 0; i < threads.length; i++)

56 {

57 if(i != 0)

BSHLiteral.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 140 lines ✨ Summary

This Java class, BSHLiteral, represents a literal value in BeanShell scripting language. It extends SimpleNode and overrides the eval method to return the stored value. The class handles escape sequences for special characters like \b, \t, etc., by replacing them with their corresponding Unicode values or characters.

104 {

105 StringBuilder buffer = new StringBuilder();

106 for(int i = 0; i < str.length(); i++)

107 {

108 char ch = str.charAt(i);

bootstrap.js (http://enginey.googlecode.com/svn/trunk/) JavaScript · 463 lines ✨ Summary

This JavaScript code is a part of the Dojo toolkit, a popular JavaScript library for building web applications. It provides various utility functions and APIs for tasks such as object manipulation, event handling, and debugging. The code defines several functions that can be used to perform common operations in a web application, including eval, deprecated, and experimental markers.

116 ];

117 var i=0, tn;

118 while((tn=cn[i++])){

119 if(!console[tn]){

120 (function(){

301 // | // will print "true"

302 // | console.debug(flattened.braces);

303 for(var i=1, l=arguments.length; i<l; i++){

304 d._mixin(obj, arguments[i]);

305 }

309 dojo._getProp = function(/*Array*/parts, /*Boolean*/create, /*Object*/context){

310 var obj=context || d.global;

311 for(var i=0, p; obj && (p=parts[i]); i++){

312 if(i == 0 && this._scopeMap[p]){

313 p = this._scopeMap[p];

sorter.js (http://enginey.googlecode.com/svn/trunk/) JavaScript · 89 lines ✨ Summary

This JavaScript code defines a sorting function for data sets. It creates a custom comparator function based on user-defined attributes and their corresponding sorting directions. The basicComparator function is used as a fallback if no specific comparator is defined, treating undefined values as larger. The createSortFunction helper function generates the sorting function based on the provided attribute array and store object.

66 }

67 var sortAttribute;

68 for(var i = 0; i < sortSpec.length; i++){

69 sortAttribute = sortSpec[i];

70 if(sortAttribute.attribute){

77 var i=0;

78 while(i < sortFunctions.length){

79 var ret = sortFunctions[i++](rowA, rowB);

80 if(ret !== 0){

81 return ret;//int

CommandoDialog.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 872 lines ✨ Summary

This Java code defines a graphical user interface (GUI) for a text editor, specifically designed to display and edit settings for a command-line based application. It creates panels for displaying settings, such as checkboxes, dropdown menus, and text areas, allowing users to configure the application’s behavior. The GUI is built using Swing components and layouts.

77 command = jEdit.getProperty("commando.last-command");

78

79 for(int i = 0; i < commands.length; i++)

80 {

81 if(commands[i].name.equals(command))

118 Vector commands = new Vector();

119

120 for(int i = 0; i < scripts.size(); i++)

121 {

122 Script script = (Script)scripts.elementAt(i);

230 StringBuffer buf = new StringBuffer();

231

232 for(int i = 0; i < scripts.size(); i++)

233 {

234 Script script = (Script)scripts.elementAt(i);

DefaultShell.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 429 lines ✨ Summary

This Java code implements a console output system for an integrated development environment (IDE). It creates a new process to execute a command, reads its standard output and error streams, and displays them in the IDE. The process can be stopped and waited for to complete, allowing the IDE to display the exit status of the executed command.

80 // Expand variables

81 StringBuffer buf = new StringBuffer();

82 for(int i = 0; i < command.length(); i++)

83 {

84 char c = command.charAt(i);

wl3501_cs.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 2131 lines ✨ Summary

This C code implements a wireless driver for the Planet WL3501 wireless card. It provides functions for probing, suspending, and resuming the device, as well as handling PCMCIA configuration and network registration. The code is part of the Linux kernel’s pcmcia subsystem and uses the iwlib library to interact with the wireless card.

178 int i, rc = 0;

179

180 for (i = 0; i < ARRAY_SIZE(iw_channel_table); i++)

181 if (reg_domain == iw_channel_table[i].reg_domain) {

182 rc = channel >= iw_channel_table[i].min &&

197 int i, rc = 1;

198

199 for (i = 0; i < ARRAY_SIZE(iw_channel_table); i++)

200 if (reg_domain == iw_channel_table[i].reg_domain) {

201 rc = iw_channel_table[i].deflt;

707 matchflag = 1;

708 if (matchflag) {

709 for (i = 0; i < this->bss_cnt; i++) {

710 if (!memcmp(this->bss_set[i].bssid,

711 sig.bssid, ETH_ALEN)) {

utilities.cpp (https://bitbucket.org/ultra_iter/qt-vtl.git) C++ · 827 lines

166 unsigned int mask = std::numeric_limits<unsigned int>::max() >> (std::numeric_limits<unsigned int>::digits - allocationSize);

167

168 for (unsigned int i = 0; i < bitsSize - allocationSize + 1; i++)

169 {

170 if ((*bits & mask) == 0)

Patch.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 395 lines ✨ Summary

This Java code implements a patch editor that applies changes to a text file by applying chunks of text, known as “patches”, to the original file. It supports three types of patches: add (insertion), change (replacement), and delete (removal). The code uses an offset-based system to apply patches to the original file, allowing for precise control over where in the file each patch is applied.

100 // count the chunks

101 int numChunks = 0;

102 for ( int i = 0; i < patchSrc.length; i++ ) {

103 if ( startWithNumber( patchSrc[ i ] ) ) {

104 numChunks++;

116 int to1buf = -1;

117 int to2buf = -1;

118 for ( int i = 0; i < patchSrc.length; i++ ) {

119 if ( startWithNumber( patchSrc[ i ] ) ) {

120 // save the old from buffers

220 */

221 int offset = 0;

222 for ( int i = 0; i < chunks.length; i++ ) {

223 // apply this chunk

224 Chunk c = chunks[ i ];

OperatingSystem.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 362 lines ✨ Summary

This Java code defines a class that determines the operating system and Java version of the running application. It uses various methods to detect the OS, including checking system properties and file separators. The detected values are stored in instance variables for later use. The class can be used to customize behavior based on the detected environment.

93 // O(n^3), this is nasty, but since we aren't dealling with

94 // many items it should be fine

95 for (int i=0; i < gd.length; i++)

96 {

97 GraphicsConfiguration gc = gd[i]

query.php (http://forceworkbench.googlecode.com/svn/trunk/workbench/) PHP · 996 lines ✨ Summary

This PHP code is part of a Salesforce Workbench application, handling query-related functionality. It generates query results, exports data to CSV, and allows users to execute queries asynchronously. The code also handles errors, warnings, and export options, providing a user-friendly interface for interacting with Salesforce data.

195

196 var isFieldSelected = false;

197 for (var i = 0; i < QB_field_sel.options.length; i++)

198 if (QB_field_sel.options[i].selected)

199 isFieldSelected = true;

253 function exportActionIs(type) {

254 var exportActions = document.getElementById('query_form')['export_action'];

255 for (var i = 0; i < exportActions.length; i++) {

256 if (exportActions[i].checked && exportActions[i].value == type) {

257 return true;

276 var QB_field_sel = document.getElementById('QB_field_sel');

277 QB_fields_selected = new Array();

278 for (var i = 0; i < QB_field_sel.options.length; i++) {

279 if (QB_field_sel.options[i].selected) {

280 QB_fields_selected.push(QB_field_sel.options[i].value);

PluginLoader.as (http://flowplayer-core.googlecode.com/svn/) ActionScript · 350 lines ✨ Summary

This ActionScript code is a plugin loader for Adobe Flash Player. It loads and initializes plugins, such as fonts, display objects, and stream providers, from external sources. The code manages the loading process, handles errors, and sets up configuration for each plugin. It also provides access to loaded plugins through various methods, allowing developers to interact with them in their application.

126 }

127

128 for (var i:Number = 0; i < _loadables.length; i++) {

129 Loadable(_loadables[i]).onError(_loadErrorListener);

130 }

160 private function getPluginSwiffUrls(plugins:Array):Array {

161 var result:Array = new Array();

162 for (var i:Number = 0; i < plugins.length; i++) {

163 var loadable:Loadable = Loadable(plugins[i]);

164 if (! loadable.isBuiltIn && loadable.url && result.indexOf(loadable.url) < 0) {

170

171 private function intitializeBuiltInPlugins(plugins:Array):void {

172 for (var i:int = 0; i < plugins.length; i++) {

173 var loadable:Loadable = plugins[i] as Loadable;

174 log.debug("intitializeBuiltInPlugins() " + loadable);

indycam.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 387 lines ✨ Summary

This C code defines a Linux kernel module that interacts with an IndyCam camera device over I2C. It initializes the camera, sets up its core operations, and provides a probe function to detect and initialize the device. The code also includes functions for controlling the camera’s settings, such as white balancing, and registers the device with the Linux kernel.

121 int i, err;

122

123 for (i = 0; i < length; i++) {

124 err = indycam_write_reg(sd, reg + i, data[i]);

125 if (err)

138 u8 val;

139

140 for (i = 0; i < 9; i++) {

141 indycam_read_reg(sd, i, &val);

142 dprintk("Reg %d = 0x%02x\n", i, val);

DefaultInputHandler.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 409 lines ✨ Summary

This Java code defines a class DefaultInputHandler that handles keyboard input for a text area. It maps key strokes to actions, such as inserting characters, deleting characters, and invoking custom actions. The class uses a configuration file-like approach to define the mapping between key strokes and actions. It also supports different operating systems and provides logging functionality in case of errors.

331 if(index != -1)

332 {

333 for(int i = 0; i < index; i++)

334 {

335 switch(Character.toUpperCase(keyStroke

Gutter.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 761 lines ✨ Summary

This Java code defines a custom text editor component with features such as folding, bracket highlighting, and mouse event handling. It includes a MouseHandler class that handles mouse events for the text area, including dragging and collapsing/expandning folds. The code also sets up tooltips and handles keyboard shortcuts.

100 if(highlights.size() != 0)

101 {

102 for(int i = 0; i < highlights.size(); i++)

103 {

104 TextAreaHighlight highlight = (TextAreaHighlight)

442 public String getToolTipText(MouseEvent evt)

443 {

444 for(int i = 0; i < highlights.size(); i++)

445 {

446 TextAreaHighlight highlight =

JavaCharStream.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 585 lines ✨ Summary

This Java code is a part of a text processing library, specifically designed to parse and manipulate text data. It appears to be responsible for adjusting line and column numbers when a token starts, and also provides methods for getting image representations of the text data, such as a string representation of the current buffer position.

561 bufcolumn[j] = newCol + columnDiff;

562 columnDiff = nextColDiff;

563 i++;

564 }

565

569 bufcolumn[j] = newCol + columnDiff;

570

571 while (i++ < len)

572 {

573 if (bufline[j = start % bufsize] != bufline[++start % bufsize])

XmlParsedData.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 381 lines ✨ Summary

This Java class appears to be a part of an XML parser, providing functionality for parsing and analyzing XML tags. It contains methods for finding allowed elements, attributes, and prefixes within a given tag context, as well as generating XPath expressions based on the parsed data. The class seems to be designed to support advanced XML processing tasks.

159 nsToPrefix.put(ns,prefix);

160

161 for(int i=2;i<steps.length;i++)

162 {

163 DefaultMutableTreeNode cur=(DefaultMutableTreeNode)steps[i];

224 xpath += rootName.getLocalName();

225

226 for(int i=0;i<preXPath.length;i++)

227 {

228 prefix = nsToPrefix.get(preXPath[i].getNamespaceUri());

BSHParserTokenManager.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 2655 lines ✨ Summary

This Java code is part of a lexical analyzer for a programming language, specifically designed to parse strings with various characters such as quotes, parentheses, and special characters. It uses a finite state machine (FSM) approach to recognize patterns in input strings and generate output tokens. The FSM has multiple states and transitions based on the input character.

59 }

60 indent = "";

61 for (int i = 0; i < w; i++) {

62 indent += " ";

63 }

191 ArrayList list = new ArrayList();

192 String s = new String("");

193 for (int i = 0; i < a.size(); i++) {

194 Object o = a.get(i);

195 if (o instanceof Token) {

211 }

212 }

213 for (int i = 0; i < list.size(); i++) {

214 b.append((String)list.get(i));

215 }

ParseException.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 188 lines ✨ Summary

This Java code defines a custom exception class ParseException that is used to handle parse errors in a parser generated by JavaCC. It provides constructors for creating exceptions with different levels of detail, including a constructor that generates an error message based on the current token and expected tokens. The exception includes fields such as the current token, expected token sequences, and a reference to the “tokenImage” array.

92 StringBuffer expected = new StringBuffer();

93 int maxSize = 0;

94 for (int i = 0; i < expectedTokenSequences.length; i++) {

95 if (maxSize < expectedTokenSequences[i].length) {

96 maxSize = expectedTokenSequences[i].length;

106 String retval = "Encountered \"";

107 Token tok = currentToken.next;

108 for (int i = 0; i < maxSize; i++) {

109 if (i != 0) retval += " ";

110 if (tok.kind == 0) {

142 StringBuffer retval = new StringBuffer();

143 char ch;

144 for (int i = 0; i < str.length(); i++) {

145 switch (str.charAt(i))

146 {

FileTypeUtil.java (https://bitbucket.org/nbargnesi/idea.git) Java · 434 lines

139

140 preview.append(open);

141 for (int i = open.length() + 1; i <= options.getLenBefore() - diff - post.length(); i++)

142 {

143 preview.append(filler);

201 {

202 preview.append(pre);

203 for (int i = leader.length() + pre.length(); i < options.getLenAfter() - close.length(); i++)

204 {

205 preview.append(filler);

TextAreaInputHandler.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 383 lines ✨ Summary

This Java class appears to be part of a text editor, handling keyboard input and processing keystrokes. It checks for various key combinations, such as modifier keys, numeric keypad inputs, and user-defined shortcuts, and performs actions accordingly, including invoking commands, setting bindings, and sending shortcut prefix off signals.

213 buffer.beginCompoundEdit();

214

215 for(int i = 0; i < _repeatCount; i++)

216 action.invoke(textArea);

217 }

jEdit.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 4373 lines ✨ Summary

This Java code is part of a text editor application, managing views and user interactions. It handles view creation, closing, and switching between views. It also manages settings, garbage collection, and memory usage. The code provides methods for getting and setting various properties, such as the number of open views, the currently active view, and whether jEdit is running in background mode.

146 String scriptFile = null;

147

148 for(int i = 0; i < args.length; i++)

149 {

150 String arg = args[i];

478

479 //{{{ Activate plugins that must be activated at startup

480 for(int i = 0; i < jars.size(); i++)

481 {

482 jars.elementAt(i).activatePluginIfNecessary();

loss_interval.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 186 lines ✨ Summary

This C code implements a loss interval database for DCCP (Datagram Congestion Control Protocol) networks. It manages a circular buffer of loss intervals, tracking packet losses and calculating mean loss intervals. The code provides functions to update the loss interval database, add new records, and calculate mean loss intervals based on packet sequence numbers and congestion control values.

70 return;

71

72 for (i = 0; i <= k; i++) {

73 i_i = tfrc_lh_get_interval(lh, i);

74

scm.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 317 lines ✨ Summary

This C code implements a part of the Linux kernel’s file descriptor management system, specifically for sending file descriptors over network connections using the SCM_RIGHTS message type. It allows a process to send its open files to another process, which can then receive and use them without having to create new file descriptors. The code provides functions for creating, manipulating, and sending file descriptor lists between processes.

89 */

90

91 for (i=0; i< num; i++)

92 {

93 int fd = fdp[i];

248

249 for (i=0, cmfptr=(__force int __user *)CMSG_DATA(cm); i<fdmax;

250 i++, cmfptr++)

251 {

252 int new_fd;

packet_history.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 490 lines ✨ Summary

This C code implements a timestamp-based congestion control algorithm for TCP-like protocols, specifically DCCP (Datagram Congestion Control Protocol). It manages a ring buffer to store timestamp and CCVal values, sampling RTT (Round-Trip Time) from these values to adjust congestion control parameters. The code provides functions for allocating and purging the ring buffer, as well as computing RTT samples based on timestamp and CCVal values.

180 return 1;

181

182 for (i = 1; i <= h->loss_count; i++)

183 if (tfrc_rx_hist_entry(h, i)->tfrchrx_seqno == seq)

184 return 1;

391 int i;

392

393 for (i = 0; i <= TFRC_NDUPACK; i++) {

394 h->ring[i] = kmem_cache_alloc(tfrc_rx_hist_slab, GFP_ATOMIC);

395 if (h->ring[i] == NULL)

Greedy_Delete.bsh (https://jedit.svn.sourceforge.net/svnroot/jedit) Unknown · 88 lines

58

59 int count = 0;

60 for(int i=0; i < toTabStop; i++)

61 {

62 if(!" ".equals(buffer.getText(caret+i,1)))

CloseDialog.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 244 lines ✨ Summary

This Java code creates a dialog window for closing all buffers in an integrated development environment (IDE). It displays a list of open buffers, allows users to select and save or discard them, and provides options to cancel or close all buffers. The dialog updates its buttons based on the selected buffer index.

63

64 Buffer[] buffers = jEdit.getBuffers();

65 for(int i = 0; i < buffers.length; i++)

66 {

67 Buffer buffer = buffers[i];

172 Object[] paths = bufferList.getSelectedValues();

173

174 for(int i = 0; i < paths.length; i++)

175 {

176 String path = (String)paths[i];

201 Object[] paths = bufferList.getSelectedValues();

202

203 for(int i = 0; i < paths.length; i++)

204 {

205 String path = (String)paths[i];

Display_Abbreviations.bsh (https://jedit.svn.sourceforge.net/svnroot/jedit) Unknown · 386 lines

65 Vector setVector = new Vector(modes.length + 1);

66 setVector.addElement("global");

67 for(int i = 0; i < modes.length; i++)

68 {

69 String name = modes[i].getName();

VariableGridLayout.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 333 lines ✨ Summary

This Java code implements a variable grid layout manager for Swing components. It dynamically adjusts the number of rows and columns based on the component count, and calculates the preferred size of each row and column accordingly. The layout is updated when the container’s component count changes, ensuring that all components are properly laid out within the available space.

174 int total_height = 0;

175 for (int r = 0, i = 0; r < nrows; r++) {

176 for (int c = 0; c < ncols; c++, i++) {

177 if (i < ncomponents) {

178 Dimension d = parent.getComponent(i).getPreferredSize();

213 // Pass 3: layout components

214 for (int r = 0, y = insets.top, i = 0; r < nrows; y += row_heights[r] + vgap, r++) {

215 for (int c = 0, x = insets.left; c < ncols; x += col_widths[c] + hgap, c++, i++) {

216 if (i < ncomponents) {

217 parent.getComponent(i).setBounds(x, y, col_widths[c], row_heights[r]);

252 for (int r = 0, i = 0; r < nrows; r++) {

253 int row_height = 0;

254 for (int c = 0; c < ncols; c++, i++) {

255 if (i < ncomponents) {

256 switch (which) {

PropertyUtil.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 83 lines ✨ Summary

This Java class, PropertyUtil, provides utility methods for accessing properties. It allows you to retrieve and set property values with a specific format, where keys are prefixed with a dot and an index. The class uses a Properties object to store and retrieve these values.

45 int i = 0;

46 String value;

47 while ((value = properties.getProperty(calculateKey(key, i++))) != null) {

48 values.add(value);

49 }

64 public static void setEnumeratedProperty (String key, List values, Properties properties) {

65 List currentValues = getEnumeratedProperty(key, properties);

66 for (int i=0; i < currentValues.size(); i++) {

67 properties.remove(calculateKey(key, i));

68 }

69 for (int i=0; i < values.size(); i++) {

70 properties.setProperty(calculateKey(key, i), (String)values.get(i));

71 }

StylesheetParameterTableModel.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 237 lines ✨ Summary

This Java code defines a table model for XSL stylesheet parameters, allowing users to add, edit, and delete parameter names and values in a table. It provides methods for adding, removing, and editing parameters, as well as getting the current value of each parameter at a specific row and column index.

188 fireTableRowsDeleted(i, i);

189 }

190 i++;

191 }

192

NonInteractiveInstall.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 66 lines ✨ Summary

This Java class, NonInteractiveInstall, performs a non-interactive installation by creating an instance of the Install class and starting an InstallThread. The thread is configured to install components based on the operating system and filesets specified in properties. It uses a console progress bar to display the installation process.

37 Vector components = new Vector(compCount);

38

39 for(int i = 0; i < compCount; i++)

40 {

41 String fileset = installer.getProperty("comp." + i + ".fileset");

matroxfb_DAC1064.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 1083 lines ✨ Summary

This C code is part of a Linux kernel module that initializes and configures a Matrox graphics card, specifically the Mystique and G100 models. It sets up the card’s clock frequencies, DAC settings, and other hardware parameters to enable proper operation. The code also restores the card’s state after initialization and shutdown, ensuring that the system can resume from a previous state when the module is unloaded.

380 int i;

381

382 for (i = 0; i < 256; i++) {

383 hw->DACpal[i * 3 + 0] = i;

384 hw->DACpal[i * 3 + 1] = i;

389 int i;

390

391 for (i = 0; i < 32; i++) {

392 /* with p15 == 0 */

393 hw->DACpal[i * 3 + 0] = i << 3;

402 int i;

403

404 for (i = 0; i < 64; i++) { /* 0..63 */

405 hw->DACpal[i * 3 + 0] = i << 3;

406 hw->DACpal[i * 3 + 1] = i << 2;

BSHArrayInitializer.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 148 lines ✨ Summary

This Java code defines a class BSHArrayInitializer that extends SimpleNode. It is used to initialize arrays in a scripting language, allowing for dynamic array creation with variable dimensions and initializers. The class evaluates an array initializer syntax and creates an array of the specified base type with the given dimensions and initializers.

69

70 // Evaluate the initializers

71 for (int i = 0; i < numInitializers; i++)

72 {

73 SimpleNode node = (SimpleNode)jjtGetChild(i);

op_model_v7.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 412 lines ✨ Summary

This C code implements a profiling system for ARMv7 processors, specifically designed to measure performance counters and interrupts on these systems. It sets up interrupt handlers, requests interrupts, and provides a way to stop and start the profiling system. The code also includes debugging features and is part of an architecture-specific profiling framework.

305 int ret = 0;

306

307 for (i = 0; i < nr; i++) {

308 ret = request_irq(irqs[i], armv7_pmnc_interrupt,

309 IRQF_DISABLED, "CP15 PMNC", NULL);

327 unsigned int i;

328

329 for (i = 0; i < nr; i++)

330 free_irq(irqs[i], NULL);

331 }

SqlServerType.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 745 lines ✨ Summary

This Java code is part of a system that loads and manages SQL server types, including statements and connection parameters. It uses XML files to store this information and provides methods for loading and resolving entities in these files. The code also includes classes for representing statements and connection parameters, as well as a resolver for handling entity references in the XML files.

578

579 MiscUtilities.quicksort( dbTypes, new MiscUtilities.StringICaseCompare() );

580 for ( int i = 0; i < dbTypes.length; i++ )

581 {

582 final String dbType = dbTypes[i];

ArUtils.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 156 lines ✨ Summary

This Java class provides utility methods for working with byte streams, specifically parsing and writing header data from a buffer. It includes methods to parse octal strings, entry names, integers, long values, and write these values into a byte array, padding with spaces as needed. The methods are designed to work with specific formats used in file systems.

18 int end = offset + length;

19

20 for (int i=offset ; i<end ; i++) {

21 if (header[i] == (byte) ' ') {

22 break;

40 int end = offset + length;

41

42 for (int i=offset ; i<end ; i++) {

43 if (header[i] == ' ') {

44 break;

64 int c = name.length();

65

66 for (i=0 ; i<length && i<c ; i++) {

67 buf[offset+i] = (byte) name.charAt(i);

68 }

This.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 337 lines ✨ Summary

This Java code defines a class This that represents a scripted object in a Java-based scripting environment, such as Jython. It provides methods for invoking scripted methods on an object, including binding to a parent’s namespace and reinitializing the call stack. The class also allows invocations of certain method names on This objects, bypassing its own behavior.

120 throws UtilEvalError

121 {

122 for(int i=0; i<ca.length; i++)

123 if ( !(ca[i].isInstance( this )) )

124 throw new UtilEvalError(

227 {

228 Object [] oa = new Object [args.length];

229 for(int i=0; i<args.length; i++)

230 oa[i] = ( args[i] == null ? Primitive.NULL : args[i] );

231 args = oa;

memory.c (https://swig.svn.sourceforge.net/svnroot/swig) C · 220 lines ✨ Summary

This C code implements a memory management system for objects, including allocation and deallocation of memory blocks. It creates a pool of memory and manages a list of free objects to reduce fragmentation. The DohObjMalloc function allocates memory for new objects, while DohObjFree frees the allocated memory. The DohMemoryDebug function displays statistics on memory usage and object types.

180 int i;

181 int nused = 0, nfree = 0;

182 for (i = 0; i < p->len; i++) {

183 if (p->ptr[i].refcount <= 0) nfree++;

184 else {

206 while(p) {

207 int i;

208 for (i = 0; i < p->len; i++) {

209 if (p->ptr[i].refcount > 0) {

210 if (p->ptr[i].type == &DohStringType) {

AboutDialog.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 236 lines ✨ Summary

This Java code creates a dialog box for displaying information about an application, specifically jEdit. The dialog contains an image of an “About” icon, version number, and text describing the application’s features. The text is animated to slide up from the bottom of the dialog, creating a simple animation effect.

150 int y = firstLineOffset;

151

152 for(int i = 0; i <= lines; i++)

153 {

154 if(i + firstLine >= 0 && i + firstLine < text.size())

PluginResURLConnection.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 131 lines ✨ Summary

This Java class, PluginResURLConnection, extends URLConnection to handle resource URLs for a jEdit plugin. It extracts the plugin and resource names from the URL, connects to the corresponding file or JAR, and provides an input stream for reading the resource. It also determines the content type of the resource based on its extension.

71 {

72 PluginJAR[] plugins = jEdit.getPluginJARs();

73 for(int i = 0; i < plugins.length; i++)

74 {

75 PluginJAR jar = plugins[i];

Macros.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 1051 lines ✨ Summary

This Java code is part of a scripting language handler for the JEdit text editor. It allows users to run scripts written in various languages, such as BeanShell, and provides a way to create and invoke macros in these languages. The code defines an abstract Handler class that encapsulates the logic for handling different scripting languages, and two concrete implementations: BeanShellHandler for BeanShell scripts.

81 buffer.beginCompoundEdit();

82

83 file_loop: for(int i = 0; i < paths.length; i++)

84 runScript(view,paths[i],false);

85 }

336 public static Handler getHandlerForPathName(String pathName)

337 {

338 for (int i = 0; i < macroHandlers.size(); i++)

339 {

340 Handler handler = macroHandlers.get(i);

354 public static Handler getHandler(String name)

355 {

356 for (int i = 0; i < macroHandlers.size(); i++)

357 {

358 Handler handler = macroHandlers.get(i);

Utils.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 99 lines ✨ Summary

This Java code provides utility methods for inserting relative paths into a text buffer within the JEdit editor. It allows users to choose a file and insert its relative path into the current buffer, using a dialog box to select the file from the file system. The getRelativePath method calculates the relative URL based on the directory structure of the chosen file.

77 int sameDirs = 0;

78 int i;

79 for (i=0; i < dirLevels; i++) {

80 if (dirsBuffer[i].equals(dirsFile[i])) {

81 sameDirs++;

85 String href = "";

86 // Backward in directories tree

87 for (i=sameDirs; i < dirsBuffer.length; i++) {

88 href += "../";

89 }

90 // Forward in directories tree

91 for (i=sameDirs; i < dirsFile.length; i++) {

92 href += dirsFile[i] + "/";

93 }

DockableWindowManager.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 1210 lines ✨ Summary

This Java code defines a dockable window manager for a text editor, allowing plugins to create and manage their own windows with customizable positions (top, left, bottom, right, or floating). The manager handles window creation, positioning, and removal, as well as plugin-specific functionality such as title setting and position registration.

123 {

124 String[] retVal = new String[dockableWindowFactories.size()];

125 for(int i = 0; i < dockableWindowFactories.size(); i++)

126 {

127 retVal[i] = ((Factory)dockableWindowFactories.elementAt(i)).name;

471 public void init()

472 {

473 for(int i = 0; i < dockableWindowFactories.size(); i++)

474 {

475 Factory factory = (Factory)

mean.h (https://freespeech.svn.sourceforge.net/svnroot/freespeech) C++ Header · 78 lines ✨ Summary

This C++ header file defines a class Mean that represents a mathematical mean of a set of values. It provides methods for accumulating values, converting to real values, resetting to accumulated values, and reading from an input stream. The class also includes an enum Mode to specify the type of mean (accumulated, real, rotated, or inverted).

36 void accumFrame(const float *v)

37 {

38 for (int i=0;i<dimension;i++)

39 this->operator[] (i) += v[i];

40 accum_count++;

43 void accumFrame(const vector<float> &v)

44 {

45 for (int i=0;i<v.size();i++)

46 this->operator[] (i) += v[i];

47 accum_count++;

51 {

52 double accum_1 = 1.0/accum_count;

53 for (int i=0;i<dimension;i++)

54 this->operator[] (i) *= accum_1;

55 mode = real;

NNetTrain.cc (https://freespeech.svn.sourceforge.net/svnroot/freespeech) C++ · 210 lines ✨ Summary

This C++ code defines a class NNetTrain that inherits from a base Node class. It represents a neural network training node in a computational graph, taking input data and producing output. The class has various parameters for configuring the training process, such as maximum epochs, learning rate, and batch sizes. It provides methods for initializing, resetting, and retrieving the output of the trained neural network.

181 //cerr << "inputs converted\n";

182 vector <float *> in(inBuff.size());

183 for (i=0;i<inBuff.size();i++)

184 in[i]=&object_cast <Vector<float> > (inBuff[i])[0];

185

186 vector <float *> out(outBuff.size());

187 for (i=0;i<outBuff.size();i++)

188 out[i]=&object_cast <Vector<float> > (outBuff[i])[0];

189

VisixProject.cc (https://freespeech.svn.sourceforge.net/svnroot/freespeech) C++ · 239 lines ✨ Summary

This C++ code defines a VisixProject class, which represents a project for managing audio files. It creates a graphical user interface (GUI) with menus and buttons to add files, view properties, and save the project to an XML file. The GUI displays a tree structure of added files and allows users to interact with them through menu options.

202 xmlSetProp(tree, (CHAR *)"name", (CHAR *)name.c_str());

203

204 for (int i=0;i<sources.size();i++)

205 {

206 sources[i]->save(tree);

228 ++i;

229 }

230 /*for (int i=0;i<sources.size();i++)

231 {

232 if (sources[i] == src)

SyntaxUtilities.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 66 lines ✨ Summary

This Java class, SyntaxUtilities, provides a utility method called regionMatches that checks if a subregion of a Segment object is equal to a character array. It takes into account case sensitivity and returns true if the match is found, false otherwise. The method is used in syntax highlighting code for text editors like jEdit.

49 return false;

50 char[] textArray = text.array;

51 for(int i = offset, j = 0; i < length; i++, j++)

52 {

53 char c1 = textArray[i];

HyperSearchRequest.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 218 lines ✨ Summary

This Java class, HyperSearchRequest, is a work request that runs in an I/O thread to perform a hypersearch operation on a given text buffer. It searches for matches of a specified pattern within the buffer and updates a tree model with the results. The search can be performed on a single buffer or multiple buffers, depending on the selection provided.

69 if(selection != null)

70 {

71 for(int i = 0; i < selection.length; i++)

72 {

73 Selection s = selection[i];

CCControl.cpp (https://bitbucket.org/Tsiannian/cocos2d-x.git) C++ · 332 lines

91 {

92 // For each control events

93 for (int i = 0; i < CONTROL_EVENT_TOTAL_NUMBER; i++)

94 {

95 // If the given controlEvents bitmask contains the curent event

111 {

112 // For each control events

113 for (int i = 0; i < CONTROL_EVENT_TOTAL_NUMBER; i++)

114 {

115 // If the given controlEvents bitmask contains the curent event

149 {

150 // For each control events

151 for (int i = 0; i < CONTROL_EVENT_TOTAL_NUMBER; i++)

152 {

153 // If the given controlEvents bitmask contains the curent event

PHPSideKickCompletion.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 173 lines ✨ Summary

This Java class, PHPSideKickCompletion, extends SideKickCompletion and provides completion functionality for PHP syntax highlighting. It analyzes the current word in a text area and suggests possible completions based on PHP classes, methods, and keywords. The class handles keystrokes, inserting suggested completions, and updating the text area’s caret position accordingly.

77 public void addOutlineableList(List items, String word)

78 {

79 for (int i = 0; i < items.size(); i++)

80 {

81 addItem(items.get(i), word);

ControlFlowBuilder.java (https://bitbucket.org/nbargnesi/idea.git) Java · 1192 lines

825 int i = 0;

826 if (scopeWhenAdded != null) {

827 for (; i < myPending.size(); i++) {

828 Pair<InstructionImpl, GroovyPsiElement> pair = myPending.get(i);

829 final GroovyPsiElement currScope = pair.getSecond();

TreeElementPattern.java (https://bitbucket.org/nbargnesi/idea.git) Java · 225 lines

118 PairProcessor<ParentType, ProcessingContext> processor) {

119 ParentType parent = t;

120 for (int i = 0; i < level; i++) {

121 if (parent == null) return false;

122 parent = getParent(parent);

180 if (patterns[j].accepts(element, context)) {

181 if (i != j) return false;

182 i++;

183 break;

184 }

TokenMarker.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 938 lines ✨ Summary

This Java code is part of a parser for regular expressions, specifically handling line-by-line parsing and syntax analysis. It manages persistent state per line, including rules, escape characters, and span information, to facilitate accurate parsing and error detection. The code provides a framework for processing input strings according to predefined grammar rules.

622 int end = start + len;

623

624 for(int i = start; i < end; i++)

625 {

626 if(Character.isWhitespace(line.array[i + line.offset]))

656 boolean mixed = false;

657

658 for(int i = lastOffset; i < pos; i++)

659 {

660 char ch = line.array[i];

733 {

734 StringBuilder buf = new StringBuilder();

735 for(int i = 0; i < end.length; i++)

736 {

737 char ch = end[i];

GCMS.cc (https://freespeech.svn.sourceforge.net/svnroot/freespeech) C++ · 108 lines ✨ Summary

This C++ code implements a node called GCMS (Generalized Cumulative Mean Shift) for a signal processing framework. It calculates the cumulative mean shift of input signals over a specified lookback period, producing an output buffer with shifted values. The node can be configured to perform this calculation on a per-frame or per-sample basis.

45 inputs[0].node->request(req);

46

47 for (int i=0;i<outputLength;i++)

48 sum[i]=0;

49 accumCount=0;

54 this->FrameOperation::reset();

55

56 for (int i=0;i<outputLength;i++)

57 sum[i]=0;

58 accumCount=0;

86 accumCount++;

87 float inv_accum=1.0/accumCount;

88 for (i=0;i<outputLength;i++)

89 {

90 sum[i] = (1-inv_accum)*sum[i] + inv_accum*in[i];

JTabbedPaneFormatter.java (http://fest.googlecode.com/svn/) Java · 82 lines ✨ Summary

This Java class, JTabbedPaneFormatter, is a formatter for Swing’s JTabbedPane components. It provides a way to convert a JTabbedPane into a string representation, including its properties such as selected tab index, title, count, and visibility. The formatter can be used in testing or logging scenarios to inspect the state of a JTabbedPane.

68 if (count == 0) return new String[0];

69 String[] titles = new String[count];

70 for (int i = 0; i < count; i++) titles[i] = tabbedPane.getTitleAt(i);

71 return titles;

72 }

BshMethod.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 429 lines ✨ Summary

This Java class represents a scripted method in a scripting language, likely used for dynamic execution of scripts. It manages variables, parameters, and return types, and provides methods for evaluating expressions, handling errors, and returning values. The class is designed to be flexible and adaptable to different scripting languages and use cases.

214 {

215 if ( argValues != null )

216 for (int i=0; i<argValues.length; i++)

217 if ( argValues[i] == null )

218 throw new Error("HERE!");

310

311 // set the method parameters in the local namespace

312 for(int i=0; i<numArgs; i++)

313 {

314 // Set typed variable

EditTagDialog.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 604 lines ✨ Summary

This Java code is a graphical user interface (GUI) component for editing XML tags. It allows users to set, edit, and compare values of attributes in an XML tag. The GUI displays a table with columns for setting, attribute name, data type, and value. Users can select values from dropdown menus or enter custom values. The code updates the GUI when changes are made to the XML tag’s attributes.

200 {

201 ArrayList stringIDs = new ArrayList(ids.size());

202 for(int i = 0; i < ids.size(); i++)

203 {

204 stringIDs.add(((IDDecl)ids.get(i)).id);

206

207 ArrayList attributeModel = new ArrayList();

208 for(int i = 0; i < declaredAttributes.size(); i++)

209 {

210 ElementDecl.AttributeDecl attr =

258 buf.append(elementName);

259

260 for(int i = 0; i < attributeModel.size(); i++)

261 {

262 Attribute attr = (Attribute)attributeModel.get(i);

AntXmlTag.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 92 lines ✨ Summary

This Java class represents an Ant XML tag, parsing its attributes and providing methods to access its original name and icon based on its type. It extends another XmlTag class and uses Eclipse IconsPlugin for retrieving icons. The class is designed to handle different types of Ant XML tags, such as project, target, property, import, macrodef, taskdef, and others.

24 Map<String, String> attrs = new LinkedHashMap<String, String>();

25

26 for (int i = 0; i < attributes.getLength(); i++) {

27 String aname = attributes.getQName(i);

28 String value = attributes.getValue(i);

Resolver.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 969 lines ✨ Summary

This Java code is part of a JEdit plugin that manages external resources, such as XML files. It handles caching, network modes, and resource updates. The code provides methods for adding, updating, and removing resources from the cache, as well as handling changes to the user’s settings and file system. It also includes a class for handling VFS (Virtual File System) updates.

234 i = 0;

235 while((id = jEdit.getProperty(prop = "xml.cache"

236 + ".public-id." + i++)) != null)

237 {

238 uri = jEdit.getProperty(prop + ".uri");

242 i = 0;

243 while((id = jEdit.getProperty(prop = "xml.cache"

244 + ".system-id." + i++)) != null)

245 {

246 uri = jEdit.getProperty(prop + ".uri");

285 String uri = null;

286 do {

287 String prop = "xml.catalog." + i++;

288 uri = jEdit.getProperty(prop);

289 if (uri == null) break;

typepass.cxx (https://swig.svn.sourceforge.net/svnroot/swig) C++ · 1224 lines ✨ Summary

This C++ code is part of a SWIG (Simplified Interface to C and other languages) compiler, which generates interface code for C++ programs to interact with C libraries. It processes types in a C++ program, normalizing them according to the SWIG typemap rules, and installing using directives to import C types into the C++ scope.

139 int len = Len(nlist);

140 int i;

141 for (i = 0; i < len; i++) {

142 Node *bcls = 0;

143 int clsforward = 0;

225 int len = Len(ilist);

226 int i;

227 for (i = 0; i < len; i++) {

228 Node *n = Getitem(ilist, i);

229 String *bname = Getattr(n, "name");

runme.java (https://swig.svn.sourceforge.net/svnroot/swig) Java · 71 lines ✨ Summary

The Java code creates objects of Circle and Square classes, accesses their static members, member data, and methods, and then deletes them to clean up memory. It prints out various properties and positions of the shapes before and after deletion, demonstrating how the classes interact with each other and manage resources.

46 System.out.println( "\nHere are some properties of the shapes:" );

47 Shape[] shapes = {c,s};

48 for (int i=0; i<shapes.length; i++)

49 {

50 System.out.println( " " + shapes[i].toString() );

Hits.cpp (https://bitbucket.org/ultra_iter/qt-vtl.git) C++ · 174 lines

123

124 int32_t end = scoreDocsLength < _length ? scoreDocsLength : _length;

125 for (int32_t i = hitDocs.size(); i < end; i++) {

126 hitDocs.push_back(_CLNEW HitDoc(scoreDocs[i].score*scoreNorm, scoreDocs[i].doc));

127 }

TermScorer.cpp (https://bitbucket.org/ultra_iter/qt-vtl.git) C++ · 120 lines

29 memset(freqs,0,32*sizeof(int32_t));

30

31 for (int32_t i = 0; i < LUCENE_SCORE_CACHE_SIZE; i++)

32 scoreCache[i] = getSimilarity()->tf(i) * weightValue;

33 }

S3Store.js (http://enginey.googlecode.com/svn/trunk/) JavaScript · 35 lines ✨ Summary

This JavaScript code defines a custom data store, dojox.data.S3Store, which extends JsonRestStore to handle Amazon’s S3 service using JSON data. It processes query results from S3 by parsing XML elements into JavaScript objects and returns the results in a standardized format for use with Dojo applications.

14 var jsResults = [];

15 var self = this;

16 for(var i=0; i <keyElements.length;i++){

17 var keyElement = keyElements[i];

18 // manually create lazy loaded Deferred items for each item in the result array

EditPane.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 1118 lines ✨ Summary

This Java code defines a custom text editor extension for JEdit, a popular open-source text editor. It provides features such as marker highlighting, gutter markers, and status updates based on user interactions. The code extends the TextArea class with new functionality, including painting valid lines, getting tool tip text, and handling status changes.

303

304 Selection[] selection = textArea.getSelection();

305 for(int i = 0; i < selection.length; i++)

306 selection[i] = (Selection)selection[i].clone();

307 buffer.setProperty(Buffer.SELECTION,selection);

374 if(selection != null)

375 {

376 for(int i = 0; i < selection.length; i++)

377 {

378 Selection s = selection[i];

473 int caret = textArea.getCaretPosition();

474

475 for(int i = 0; i < markers.size(); i++)

476 {

477 Marker _marker = markers.get(i);

InstallPanel.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 1160 lines ✨ Summary

This Java code is part of a plugin manager for an IDE (Integrated Development Environment). It provides functionality to manage plugins, including sorting and filtering plugin information, displaying plugin details in a table, and handling keyboard and mouse events. The code also includes rendering and focus management for the plugin table.

363

364 int length = getRowCount();

365 for (int i = 0; i < length; i++)

366 {

367 if (b)

402 }

403

404 for(int i = 0; i < parents.length; i++)

405 parents[i].install = false;

406

427 List<PluginList.Dependency> deps = entry.plugin.getCompatibleBranch().deps;

428

429 for (int i = 0; i < deps.size(); i++)

430 {

431 PluginList.Dependency dep = deps.get(i);

PluginOptionGroup.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 266 lines ✨ Summary

This Java code defines a class PluginOptionGroup that extends OptionGroup. It creates an option tree model for plugins, querying plugins for their options and adding them to the tree structure. The OptionTreeModel class implements the TreeModel interface, providing methods for managing the tree’s nodes and listeners.

66 // Query plugins for option panes

67 EditPlugin[] plugins = jEdit.getPlugins();

68 for(int i = 0; i < plugins.length; i++)

69 {

70 EditPlugin ep = plugins[i];

BSHTryStatement.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 175 lines ✨ Summary

This Java code implements a try-catch block for a scripting language, specifically BeanShell. It evaluates the contents of a try block and catches any resulting TargetErrors generated by the script, then executes corresponding catch blocks until one matches the thrown exception. If no match is found, it evaluates a finally block before returning control to the caller.

55 Node node = null;

56 int i=1;

57 while((i < nchild) && ((node = jjtGetChild(i++)) instanceof BSHFormalParameter))

58 {

59 catchParams.addElement(node);

60 catchBlocks.addElement(jjtGetChild(i++));

61 node = null;

62 }

102 {

103 int n = catchParams.size();

104 for(i=0; i<n; i++)

105 {

106 // Get catch block

emu10k1_patch.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 230 lines ✨ Summary

This C code is part of a synthesizer for the Emu Audio chip, specifically handling sample blocks. It allocates and frees memory for these blocks, copying data from user space to the allocated memory. The code also handles loop structures within samples, including bidirectional loops and blank loops. It ensures proper alignment and formatting of the data in the allocated memory.

134 if (offset + loopsize * 2 > blocksize)

135 return -EINVAL;

136 for (i = 0; i < loopsize; i++)

137 wblock[woffset + i] = wblock[woffset - i -1];

138 offset += loopsize * 2;

140 if (offset + loopsize > blocksize)

141 return -EINVAL;

142 for (i = 0; i < loopsize; i++)

143 block[offset + i] = block[offset - i -1];

144 offset += loopsize;

187 if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS)) {

188 unsigned short *wblock = (unsigned short*)block;

189 for (i = 0; i < truesize; i++)

190 wblock[i] ^= 0x8000;

191 } else {

Interpreter.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 1234 lines ✨ Summary

This Java code defines a class Interpreter that represents an interactive shell for executing BeanShell scripts. It provides methods for sourcing scripts, evaluating expressions, and controlling output and error streams. The class also handles security exceptions and provides features like verbose printing and exit on EOF control.

52 bsh.eval("foo=Math.sin(0.5)");

53 bsh.eval("bar=foo*5; bar=Math.cos(bar);");

54 bsh.eval("for(i=0; i<10; i++) { print(\"hello\"); }");

55 // same as above using java syntax and apis only

56 bsh.eval("for(int i=0; i<10; i++) { System.out.println(\"hello\"); }");

Mode.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 464 lines ✨ Summary

This Java class represents an editor’s indentation rules and behavior. It manages a set of rules for indenting lines, including regular expressions, bracket pairs, and whitespace handling. The class provides methods to get and set these rules, as well as determine whether certain characters are electric keys that trigger automatic indentation.

325

326 StringBuilder buf = new StringBuilder();

327 for(int i = 0; i < props.length; i++)

328 {

329 String prop = (String) getProperty(props[i]);

347 };

348

349 for(int i = 0; i < regexpProps.length; i++)

350 {

351 IndentRule rule = createRegexpIndentRule(regexpProps[i]);

361 };

362

363 for(int i = 0; i < bracketProps.length; i++)

364 {

365 createBracketIndentRules(bracketProps[i], rules);

Greedy_Right.bsh (https://jedit.svn.sourceforge.net/svnroot/jedit) Unknown · 87 lines

58 chunk = buffer.getText(caret,toTabStop);

59 int count = 0;

60 for(int i=0; i < chunk.length(); i++)

61 {

62 if(' ' != chunk.charAt(i))

SvnCachingRepositoryPoolTest.java (https://bitbucket.org/nbargnesi/idea.git) Java · 243 lines

177 cnt[0] = 25;

178 final SVNException[] exc = new SVNException[1];

179 for (int i = 0; i < 25; i++) {

180 Runnable target = new Runnable() {

181 @Override

fullpage.js (https://bitbucket.org/kraymitchell/fcd.git) JavaScript · 233 lines

165 // Setup doctype select box

166 list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(',');

167 for (i = 0; i < list.length; i++) {

168 item = list[i].split('=');

169

174 // Setup fonts select box

175 list = editor.getParam("fullpage_fonts", defaultFontNames).split(';');

176 for (i = 0; i < list.length; i++) {

177 item = list[i].split('=');

178

183 // Setup fontsize select box

184 list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(',');

185 for (i = 0; i < list.length; i++)

186 addSelectValue(form, 'fontsize', list[i], list[i]);

187

string.c (https://swig.svn.sourceforge.net/svnroot/swig) C · 912 lines ✨ Summary

This C code defines a string data type and its associated functions for manipulating strings, such as creating new strings, comparing strings, searching for substrings, and reading/writing files. It also provides object-oriented features like inheritance and polymorphism through the use of DohObjInfo and DohStringType structures. The code is part of a larger programming framework or library.

121 c1 = s1->str;

122 c2 = s2->str;

123 for (i = 0; i < maxlen; i++,c1++,c2++) {

124 if (*c1 != *c2) break;

125 }

146 c = s->str;

147 len = s->len > 50 ? 50 : s->len;

148 for (i = 0; i < len; i++) {

149 h = (((h << 5) + *(c++)));

150 }

179 if (sp >= oldlen) {

180 tc += sp;

181 for (i = sp; i < oldlen+l; i++,tc++) {

182 if (*tc == '\n') s->line++;

183 }

traps.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 768 lines ✨ Summary

This C code defines a set of exception handlers for a Linux kernel, which are triggered when specific conditions occur during execution. The handlers catch and handle exceptions such as stack overflows, division by zero, and data corruption, among others. They print error messages, trigger system calls, and perform other necessary actions to prevent the program from crashing or causing further damage.

153 stack = sp;

154

155 for (i = 0; i < kstack_depth_to_print; i++) {

156 if (((addr_t) stack & (THREAD_SIZE-1)) == 0)

157 break;

734 int i;

735

736 for (i = 0; i < 128; i++)

737 pgm_check_table[i] = &default_trap_handler;

738 pgm_check_table[1] = &illegal_op;

SRPGRCohesionEffect.java (http://loon-simple.googlecode.com/svn/trunk/) Java · 70 lines ✨ Summary

This Java class, SRPGRCohesionEffect, extends another class SRPGEffect and is used to create a cohesion effect in a role-playing game (RPG). It draws a series of shapes on the screen at a specific location, with each shape having a different size and orientation. The effect is animated over time, fading out after 40 frames.

59 next();

60 g.setColor(color);

61 for (int i = 0; i < delta.length; i++) {

62 delta[i].drawPaint(g, t_x - x, LSystem.screenRect.height - (t_y - y));

63 }

ObjectParser.h (https://freespeech.svn.sourceforge.net/svnroot/freespeech) C Header · 167 lines ✨ Summary

This C++ header file provides a basic framework for parsing and serializing objects using an XML-like syntax. It defines classes and functions for handling input/output streams, object creation, and error handling, allowing users to read and write objects in a structured format. The code includes support for vectors, pointers, and custom object factories.

36 {

37 out << "<Vector ";

38 for (int i=0; i < v.size(); i++)

39 {

40 out << " " << v[i];

48 {

49 out << "<Vector ";

50 for (int i=0; i < v.size(); i++)

51 {

52 out << " " << *(v[i]);

window.c (https://freespeech.svn.sourceforge.net/svnroot/freespeech) C · 67 lines ✨ Summary

This C code implements a window function for audio processing, specifically for the Ogg Vorbis codec. It creates an array of double values representing a sinusoidal window shape, which is used to modify audio signals in the MDCT (Modulated Discrete Cosine Transform) algorithm. The vorbis_window function takes parameters such as window type and size, and returns a dynamically allocated array of the calculated window values.

36 int i;

37

38 for(i=0;i<left;i++){

39 double x=(i+.5)/left*M_PI/2.;

40 x=sin(x);

45 }

46

47 for(i=leftbegin+left;i<rightbegin;i++)

48 ret[i]=1.;

49

50 for(i=0;i<right;i++){

51 double x=(right-i-.5)/right*M_PI/2.;

52 x=sin(x);

WordComposer.java (http://softkeyboard.googlecode.com/svn/) Java · 142 lines ✨ Summary

This Java class, WordComposer, is used to store and manage a composing word on an Android keyboard. It tracks keystrokes, stores the typed word, and provides methods for deleting characters, checking capitalization preferences, and retrieving the preferred word. The class also allows for resetting the composition and storing a user-selected word before it’s committed to a text field.

101 }

102 // StringBuffer sb = new StringBuffer(wordSize);

103 // for (int i = 0; i < wordSize; i++) {

104 // char c = (char) mCodes.get(i)[0];

105 // if (i == 0 && mIsCapitalized) {

sequential_vertex_coloring.hpp (http://hadesmem.googlecode.com/svn/trunk/) C++ Header · 0 lines ✨ Summary

This C++ header file implements a sequential vertex coloring algorithm for graphs. It takes a graph, an ordering of its vertices, and a color map as input, and returns the maximum number of colors used in the coloring. The algorithm iterates through each vertex, assigns it the smallest available color that is not used by its neighbors, and updates the color map accordingly.

66

67 //Determine the color for every vertex one by one

68 for ( size_type i = 0; i < V; i++) {

69 Vertex current = get(order,i);

70 typename GraphTraits::adjacency_iterator v, vend;

ExplicitFoldHandler.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 101 lines ✨ Summary

This Java class, ExplicitFoldHandler, is a fold handler for the jEdit text editor. It folds lines based on markers (“{{{” and “}}}”) embedded in the text, increasing the fold level when an opening bracket appears three times and decreasing it when a closing bracket appears three times.

66

67 int openingBrackets = 0, closingBrackets = 0;

68 for(int i = 0; i < count; i++)

69 {

70 switch(seg.array[offset + i])

AncestorToolBar.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 71 lines ✨ Summary

This Java code defines a custom toolbar component, AncestorToolBar, which is used to display a list of ancestor files for a given buffer in an integrated development environment (IDE). It adds buttons representing these ancestors, with their enabled state determined by the number of ancestors displayed. The toolbar also includes a “glue” component to separate it from other toolbars.

46 if (nbTokens < count)

47 {

48 for (int i = 0;i<count - nbTokens;i++)

49 {

50 remove(0);

53 else if (nbTokens > count)

54 {

55 for (int i = 0;i<nbTokens-count;i++)

56 {

57 add(new AncestorButton(), 0);

64 AncestorButton button = (AncestorButton) getComponent(i);

65 button.setAncestor(new Ancestor(view, fileName, _vfs.getFileName(fileName)));

66 i++;

67 button.setEnabled(nb != i);

68 }

Lock.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 122 lines ✨ Summary

This Java class provides a plugin for Subversion (SVN) that allows users to lock and unlock files or URLs. It takes in commit data, validates its contents, and uses SVNKit to interact with the SVN server. The class can either lock or unlock specified paths, and returns the results of the operation, including any errors that occurred.

86 if ( data.pathsAreURLs() ) {

87 SVNURL[] urls = new SVNURL[ data.getPaths().size() ];

88 for ( int i = 0; i < data.getPaths().size(); i++ ) {

89 urls[ i ] = SVNURL.parseURIDecoded( data.getPaths().get( i ) );

90 }

98 else {

99 File[] files = new File[ data.getPaths().size() ];

100 for ( int i = 0; i < data.getPaths().size(); i++ ) {

101 files[ i ] = new File( data.getPaths().get( i ) );

102 }

SuperAbbrevsIO.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 182 lines ✨ Summary

This Java code provides a utility class for managing SuperAbbrevs settings, including reading and writing mode files, copying resources from a jar file to a local directory, and creating directories as needed. It also handles file I/O operations, such as reading and writing object files, and logs errors using the Log class.

101 public static void writeDefaultAbbrevs(){

102 Mode[] modes = jEdit.getModes();

103 for(int i = 0; i < modes.length; i++){

104 String name = modes[i].getName();

105 // would be nicer if I knew how to iterate the files in the resource

HighlightPlugin.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 199 lines ✨ Summary

This Java code is for a plugin that adds highlighting functionality to the jEdit text editor. It initializes and manages highlighters for each text area, allowing users to select words or phrases to highlight, toggle highlighting on/off, and display a dialog to set custom highlights. The plugin also provides methods to add, remove, and manage highlights.

29 while (view != null) {

30 final EditPane[] panes = view.getEditPanes();

31 for (int i = 0; i < panes.length; i++) {

32 final JEditTextArea textArea = panes[i].getTextArea();

33 initTextArea(textArea);

45 while (view != null) {

46 final EditPane[] panes = view.getEditPanes();

47 for (int i = 0; i < panes.length; i++) {

48 final JEditTextArea textArea = panes[i].getTextArea();

49 uninitTextArea(textArea);

example.i (https://swig.svn.sourceforge.net/svnroot/swig) Unknown · 70 lines

59 }

60 lua_pop(the_func.L,1); /* tidy stack */

61 for(i=0;i<a;i++)

62 {

63 swiglua_ref_get(&the_func);

TwoLeggedOAuthExample.java (http://gdata-java-client.googlecode.com/svn/trunk/) Java · 117 lines ✨ Summary

This Java code demonstrates a 2-Legged OAuth flow to access Google Data using the Google Data Java Client Library. It collects user information, sets up OAuth objects, and makes a request to Google with the obtained credentials, displaying the response data.

106 System.out.println("|\tNo entries found.");

107 } else {

108 for (int i = 0; i < resultFeed.getEntries().size(); i++) {

109 BaseEntry entry = (BaseEntry) resultFeed.getEntries().get(i);

110 System.out.println("|\t" + (i + 1) + ": "

atiixp.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 1727 lines ✨ Summary

This C code implements a Linux kernel module for an ATI IXP AC97 controller, which is a sound card chip. It provides a driver for the chip and registers it with the Linux kernel. The module handles various tasks such as initializing the chip, setting up interrupts, and registering the device with the kernel. It also includes support for power management and suspend/resume operations.

388 addr = (u32)substream->runtime->dma_addr;

389 desc_addr = (u32)dma->desc_buf.addr;

390 for (i = 0; i < periods; i++) {

391 struct atiixp_dma_desc *desc;

392 desc = &((struct atiixp_dma_desc *)dma->desc_buf.area)[i];

sum_avg_cxx98.cpp (http://hadesmem.googlecode.com/svn/trunk/) C++ · 0 lines ✨ Summary

This C++ code defines a function do_sum_avg that calculates the sum and average of an array of integers. It is then wrapped in a boost::function object, which allows its address to be stored and passed around like any other pointer. The code demonstrates how a function can be stored and reused as a variable.

16 {

17 sum = 0;

18 for (int i = 0; i < n; i++)

19 sum += values[i];

20 avg = (float)sum / n;